head
head linux command cheatsheet by Thamizhiniyan C S
Last updated
head linux command cheatsheet by Thamizhiniyan C S
Last updated
-n num
Prints the first ‘num’ lines instead of the first 10 lines.
-c num
Prints the first ‘num’ bytes from the file specified.
-q
Suppresses printing filenames when more than one file is given.
-v
Prints data from the specified file preceded by its filename.
To print lines between 10 and 20 in file.txt.
Pipe the output of ls command to head to show only the three most recently modified files or folders.
Pipe the output of ls command to head and sort to display the three most recently used files or folders in alphabetical order.