Head
Name: head-output the first part of files upper part of the input document
Syntax: head [option] file
Function Description: head and tail are very straightforward. They are used to display a certain number of text blocks at the beginning and end, and head is used to display the beginning and end of the file to the standard output, tail is used to view the end of the document.
Parameters:
-N-lines: specifies the number of lines displayed.
-V-verbose output displays the file name
-C-bytes: display by the specified number of bytes
-Q quiet: Hiding file names
Instance:
1) display the first four lines of the file
[Root @ bogon ~] # Head-n 4 test. log
123
234
345
456
2) Output content except the last three lines
[Root @ bogon ~] # Head-n-3 test. log
123
8
9
10
10 is excluded. You need to check the first few rows, then add a number or-4 to the end of-n. If it is excluded, it is-n (minus sign)-4, and the last four rows are excluded.
------------------------------ Subsequent self-Summary -------------------
I think this head function is still very simple, and I have not found any complicated usage changes on the network. Paste it if someone else has it.