What are the commonly used parameters for the head command?

The commonly used parameters for the head command include:

  • -n <number>: This option allows you to specify the number of lines to display from the beginning of the file. For example, head -n 5 filename.txt will show the first 5 lines of filename.txt.
  • -c <number>: This option allows you to specify the number of bytes to display from the beginning of the file. For example, head -c 100 filename.txt will show the first 100 bytes of filename.txt.
  • -q: This option suppresses the output of the file name when multiple files are being processed.
  • -v: This option shows the file name for each file processed, even if there is only one file.

You can combine these options as needed to customize the output of the head command.

0 Comments

no data
Be the first to share your comment!