There are many commands to view the contents of files in Linux. Among those, the tail
and head
commands print the output of the last and first ten lines of a file, respectively. In some cases, the output or error of your submitted job or script creates a very big file and the most recent result prints at the end of the file. You can use tail
, instead of the cat
command, to just view the last few lines of the file. Sometimes you need multiple options with the tail
command to view the contents of the file correctly.