The head command has several options that you can use to customize its behavior. Here are some commonly used options:
-
-n: Specify the number of lines to display.head -n 5 filename.txt # Displays the first 5 lines -
-c: Specify the number of bytes to display.head -c 100 filename.txt # Displays the first 100 bytes -
-q: Suppress the output of the file headers when multiple files are specified.head -q file1.txt file2.txt # Displays the first lines of both files without headers -
-v: Always output headers giving file names, even when there is only one file.head -v filename.txt # Displays the file name before the output
These options allow you to tailor the output of the head command to suit your needs.
