Some Useful SED One-Liners


Some Useful SED One-Liners

 # Emit the first 10 lines of a file (such as 'head')     sed 10q file.txt     # Emit a double-spaced version of the file     sed 'G' file.txt     # Emit number of lines in input file     sed -n '$=' file.txt     # Emit the last line of a file     sed '$!d' file.txt     # Emit all lines greater than 30 characters in length     sed -n '/^.\{30\}/p' file.txt     # Emit all non-blank lines     sed '/^$/d' file.txt     # Remove all blank lines at the top of a file     sed '/./,$!d' file.txt 



GNU/Linux Application Programming
GNU/Linux Application Programming (Programming Series)
ISBN: 1584505680
EAN: 2147483647
Year: 2006
Pages: 203
Authors: M. Tim Jones

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net