The head command is used to display the content at the beginning of the file. By default, the head command displays the first 10 lines of the file. Syntax: head [option]... [file]...
The head command is used to display the content at the beginning of the file. By default, the head command displays the first 10 lines of the file. The specific usage is as follows:
When using the head command, you can choose different options and parameters as needed. For example, to display the first 10 lines of a file, you can use the following command:
head filename.txt
If you want to display the first 5 lines of each file, you can use the following command:
head -n 5 file1.txt file2.txt
If you want To display the first 20 bytes of each file, you can use the following command:
head -c 20 file1.txt file2.txt
In short, the head command is a very practical command line tool for quickly viewing the beginning of the file.
The above is the detailed content of Usage of head command. For more information, please follow other related articles on the PHP Chinese website!