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 -
-c: Display the first specified number of bytes instead of lines.head -c 100 filename.txt -
-q: Suppress the output of the file headers when multiple files are being processed.head -q file1.txt file2.txt -
-v: Always output headers giving file names, even if there is only one file.head -v filename.txt -
--help: Display help information about the command and its options.head --help -
--version: Display version information about theheadcommand.head --version
You can combine these options as needed. For example, to display the first 10 bytes of a file without headers, you could use:
head -c 10 -q filename.txt
