Head Name: head-outputthefirstpartoffiles upper-end content syntax of the input document: head [option] file function description: head and tail are very straightforward, it is used to display the beginning and end of a certain number of text blocks, head is used to display the beginning of the file to the standard output, tail is used to view the end of the document. Parameter:-n? -V? Verbose head
Name:Head-output the first part of files
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. head is used to display the beginning of the file to the standard output, and tail is used to view the end of the document.
Parameters:
-N? Lines
-V? Verbose output 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.