How Do I Copy the Last N Line in Linux?
Contents How Do I Get the Last N 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 get the last n 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 copy the last 10 lines in Linux?
1. counting the number of lines in the file, using `cat f. txt | wc -l` and then using head and tail in a pipeline to print out the last 81424 lines of the file (lines #totallines-81424-1 to #totallines).