English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux tail Befehl

Linux Command大全

Der Befehl tail kann verwendet werden, um den Inhalt der Datei anzuzeigen und hat einen häufig verwendeten Parameter -F häufig verwendet, um veränderliche Logdateien zu konsultieren.

tail -f filename will display the latest content of the file filename on the screen and refresh it continuously, as long as the filename is updated, the latest file content can be seen.

Command Format:

tail [parameters] [file]

Parameters:

  • -f Loop reading

  • -q Do not display processing information

  • -v Display detailed processing information

  • -c<number> Display the number of bytes

  • -n<line number> Display the last n lines of the file

  • --pid=PID and-Interval, indicating that the process will end after the process ID, PID, dies.

  • -q, --quiet, --silent Never outputs the prefix of the file name

  • -s, --sleep-interval=S and-Interval, indicating that the process will sleep for S seconds each time it repeats.

Example

To display the last 10 lines, please enter the following command:

tail notes.log

To track the growth of the file named notes.log, please enter the following command:

tail -f notes.log

This command displays the last 10 When certain lines are added to the notes.log file, the tail command will continue to display these lines. The display will continue until you press (Ctrl-Press the (C) combination key to stop the display.

Display the content of the file notes.log from the line 20 lines to the end of the file:

tail -n +20 notes.log

Display the last 10 characters:

tail -c 10 notes.log

Linux Command大全