If you know that you want all of the lines in a given file from n to EOF the following is the sed command:
sed -n '3,$p' some_file.txt
To print out lines 2 – 5 simply modify it to:
sed -n '2,5p' some_file.txt
Principal Software Engineer/Architect, motorcyclist, drummer, and artist
If you know that you want all of the lines in a given file from n to EOF the following is the sed command:
sed -n '3,$p' some_file.txt
To print out lines 2 – 5 simply modify it to:
sed -n '2,5p' some_file.txt
Here is a quick one-liner for trimming a specific number of characters from the end of a string under bash:
# Remove the last 5 characters
$ echo "somestringwith12345" | sed "s/.....$//g"
$ somestringwith
# Remove the last 3 characters
$ echo "somestringwith12345" | sed "s/...$//g"
$ somestringwith12
→ Continue reading “Removing The Last N Character From a String in Bash Script with sed”