head until last line code example Example: head until last line sed \$d #For grepping all lines of a file except last line