tail
FilesBeginner In simulator In real LinuxPrint the last lines of files
Name: tail
You can practise it right away in the simulator, and use it in real Linux mode too.
Description
tail prints the end of a file, the last 10 lines by default. -n +N starts at line N instead, handy for skipping a header.
-f (follow) keeps waiting and prints new lines as they are appended, the classic way to watch a log; -F also survives log rotation.
Syntax
tail [OPTION]... [FILE]...Common options
| -n / --lines [+]NUM | Last N lines (default 10); +N starts at line N |
| -c / --bytes [+]NUM | Show the last NUM bytes; +NUM starts at byte NUM |
| -f / --follow | Follow the file as it grows; great for logs |
| -F | Follow the name: keep going when the file is replaced (log rotation) |
| --pid PID | With -f: stop when process PID ends |
| -q / --quiet | With several files, leave out the name headers |