March 2002
Beginner
504 pages
10h 47m
English
In Chapter 3, “Working with Files,” you looked at viewing the contents of a file using the cat command. This command enables you to view an entire file, but often you need more control over lines that are displayed. The head and tail commands provide some of this control.
The head command is used to display the first few lines of a file. Its basic syntax is
head [-n lines] files
Here files is the list of the files you want the head command to process. Without the -n lines option, the head command shows the first 10 lines of its standard input. When this option is specified, head shows the number of lines specified by lines instead.
On some versions of Linux the output from the -n lines option might ... |
Read now
Unlock full access