Answers for "bash return last n characters from every line"

1

bash return last n characters from every line

# Basic syntax:
cat file.txt | rev | cut -c 1-3 | rev > output.txt
# Here we reverse each line, grab characters 1-3 (the last two 
#	characters of the original string), and then reverse the string again
Posted by: Guest on April-26-2021

Code answers related to "bash return last n characters from every line"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language