Getting head to display all but the last line of a file: command substitution and standard I/O redirection March 11, 2023 by Tarik head -n -1 will give you all except the last line of its input.