Files
2024-02-19 00:21:39 -05:00

66 lines
1.0 KiB
Plaintext

Command: tail - print the last few lines of a file
Syntax: tail [-c n] [-f] [-n n] [file] ...
Flags: -c The count refers to characters
-f On FIFO or special file, keep reading after EOF
-n The count refers to lines
Examples: tail -n 6 # Print last 6 lines of stdin
tail -c 20 file # Print the last 20 characters of
file
tail -n 1 file1 file2 # Print last line of two files
tail -n +8 file # Print the tail starting with line
8
The last few lines of one or more files are printed. The default
count is 10 lines. The default file is stdin. If the value of n for
the -c or -n flags starts with a + sign, counting starts at the
beginning, rather than the end of the file.