YouTip LogoYouTip

Linux Comm Head

# Linux head Command [![Image 3: Linux Command Manual](#) Linux Command Manual](#) The head command is used to view the beginning part of a file. It has a commonly used parameter `-n` to specify the number of lines to display, with a default of 10, meaning it shows 10 lines of content. If you need to view the end part of a file, use the (#) command. **Command Format:** head **Options:** * -q Hides the file name * -v Shows the file name * -c Number of bytes to display. * -n Number of lines to display. **Examples** To display the first 10 lines of the file `tutorial_notes.log`, enter the following command (the default option is `-n 10`): head tutorial_notes.log The above command is equivalent to: head -n 10 runoon_notes.log To display the first 5 lines of the file `notes.log`, enter the following command: head -n 5 tutorial_notes.log To display the first 20 bytes of a file: head -c 20 tutorial_notes.log [![Image 4: Linux Command Manual](#) Linux Command Manual](#)
← Eclipse JspOs Unlink β†’