what is the command to print last 8 lines of any text file.
Answers were Sorted based on User's Feedback
Answer / santosh sathe
1) use tail -8 filename
2) This will print last three lines of a file
cat 1.lst
hi
hello
bye
good
morning
sed -n '1,2!p' 1.lst
o/p
bye
good
morning
The last 3 lines are printed.sed command uses !(negation)
operator for skipping the 1st and 2nd line,That means it
will print all the lines except 1st and 2nd.
| Is This Answer Correct ? | 0 Yes | 1 No |
How do I use grep to search for a file?
what is the command to find out the difference between files and folders?
How to find the files that are accessed before 10 minutes?
what are the different commands used to create files?
Can you write a command to erase all files in the current directory including all its sub-directories?
What is "type" command in unix?what is the functionality??
Which RAID Levels supported by LVM?
How to convert a hidden file to normal visible file?
Differentiate cat command from more command.
How to add content of one file into another file at the beginning
what is virtual machine?
use of ls command