tail exclude last line code example Example: tail exclude last line head -n -1 file.txt #Use negative numbers after flag for last lines