The tail command
Print the last lines of files. Prints the last 10 lines of each file, or of what is piped into it. Log files grow at the end, so tail is the usual way to see what happened most recently.
Usage
tail [OPTION]... [FILE]...
Options
| -n N, --lines=N | the last N lines instead of 10 |
|---|---|
| -n +N | everything from line N to the end |
| -N | short for -n N |
Examples
tail app.logThe last 10 linestail -n 3 app.logThe last 3 linestail -n +2 data.csvEverything but the header line
Learn it step by step
Related commands
learner@sandbox: ~bash (practice)
Note: Try tail here: your home directory has sample files. Press Try beside an example, or type your own.
Enter runs · Tab completes names · ↑ ↓ step through history · Ctrl+L clears · type help for every command
A practice shell in your browser that behaves like bash on Linux for these commands. Nothing you type leaves the page.