Tail listet die letzten Zeilen eines Files aus.
Syntax
tail [+ number] [-l] [-b] [-c] [-r] [-f] [-c number | -n number] [file]
| Parameter | Beschreibung |
|---|---|
| +number | |
| -l | Units of lines. |
| -b | Units of blocks. |
| -c | Units of bytes. |
| -r | Reverse. Copies lines from the specified starting point in the file in reverse order. The default for r is to print the entire file in reverse order. |
| -f | Follow. If the input-file is not a pipe, the program will not terminate after the line of the input-file has been copied, but will enter an endless loop, wherein it sleeps for a second and then attempts to read and copy further records from the input-file. Thus it may be used to monitor the growth of a file that is being written by some other process. |
| -c number | The number option-argument must be a decimal integer whose sign affects the location in the file, measured in bytes, to begin the copying: + Copying starts relative to the beginning of the file. – Copying starts relative to the end of the file. none Copying starts relative to the end of the file. The origin for counting is 1; that is, -c+1 represents the first byte of the file, -c-1 the last. |
| -n | number Equivalent to -c number, except the starting location in the file is measured in lines instead of bytes. The origin for counting is 1; that is, -n+1 represents the first line of the file, -n-1 the last. |
| file | Name of the file you wish to display |
Beispiel
Listet die letzten 10 (default) linien aus myfile.txt auf.
tail myfile.txt
Listet die letzten 100 Linien aus myfile.txt auf.
tail myfile.txt -n 100