How Do I Get the Last 50 Lines in Linux?
Contents How Do I Show the Last 50 Lines of a File in Linux? Head -15 /Etc/Passwd to Look at the Last Few Lines of a File, Use the Tail Command. Tail Works the...
Contents
How do I show the last 50 lines of a file in Linux?
head -15 /etc/passwd
To look at the last few lines of a file, use the tail command. tail works the same way as head: type tail and the filename to see the last 10 lines of that file, or type tail -number filename to see the last number lines of the file.
How do I see the last 10 lines in Linux?
Linux tail command syntax
Tail is a command which prints the last few number of lines (10 lines by default) of a certain file, then terminates. Example 1: By default “tail” prints the last 10 lines of a file, then exits. as you can see, this prints the last 10 lines of /var/log/messages.