# 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