Tag: line

Remove Empty Characters at End of Lines

Remove empty characters at the end of each row sed -e ‘s/ *$//’ file.txt

First Two Lines

View first two lines of a file head -2 file tail -2 file # for last 2 lines

Remove Empty Lines

Remove empty lines from a file using sed sed ‘/^$/d’ file.txt Original Article

Double Space a File using Sed

Add a \n after every line in a file using the sed command… sed G

Get the First Line of Command Output in Shell

Get just the first line of the output of a command… <command>|head -n1 ls -1|head -n1

Replace \n with another String

The command to convert all \n in a file to another string – very useful for list code generation. perl…