Common Linux commands (13) and common linux commands
The head and tail are just as easy to understand as their names. They are used to display a certain number of text blocks at the beginning or end, and the head is used to display the beginning of the file to the standard output, and tail takes it for granted that it is the end of the file.
1.Command Format:
Head [parameters]... [file]...
2.Command function:
The head command is used to display the beginning of the file to the standard output. The default head command prints the first 10 lines of the corresponding file.
3.Command parameters:
-Q: Hide the file name.
-V: display file name
-C <byte> display Byte Count
-N <number of rows> Number of displayed rows
4.Instance used:
Instance 1:Display the first five lines of a file
Command: head-n 5 log44.log
Example 2:Display the content of the file except the last 6 lines
Command: head-n-6 log44.log
Example 3:Display the first 20 characters of a file
Command: head-c 20 log44.log
Example 4:Display the content of the file except the last 32 characters
Command: head-c-32 log44.log