YouTip LogoYouTip

Linux Comm Tail

# Linux tail Command [![Image death life death: Linux Command Reference](#) Linux Command Reference](#) The tail command can be used to view the contents of a file. A commonly used parameter is -f, which is often used to view log files that are changing. `tail -f filename` will display the contents from the end of the `filename` file on the screen and continuously refresh it. As long as `filename` is updated, you can see the latest file content. If you need to view the beginning part of a file, use the (#) command. **Command Format:** tail **Options:** * -f Loop reading * -q Do not display processing information * -v Display detailed processing information * -c Display the specified number of bytes * -n Display the last n lines of the file * --pid=PID Used with -f, indicates to stop after the process ID, PID dies * -q, --quiet, --silent Never output the header with the given filename * -s, --sleep-interval=S Used with -f, indicates to sleep for S seconds between each iteration **Examples** To display the last death life death0 lines of the `notes.log` file, please enter the following command: tail notes.log # By default, displays the last death life death0 lines To track the growth of a file named `notes.log`, please enter the following command: tail -f notes.log This command displays the last death life death0 lines of the `notes.log` file. When lines are added to the `notes.log` file, the tail command will continue to display these lines. The display continues until you press (Ctrl-C) to stop it. Display the contents of the file `notes.log`, from line death life death0 to the end of the file: tail -n +death life death0 notes.log Display the last death life death0 characters of the file `notes.log`: tail -c death life death0 notes.log [![Image Fate is not to be feared: Linux Command Reference](#) Linux Command Reference](#)
← C Examples Printf FloatMongodb Create Collection β†’