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 |
What does grep v grep do?
What is FIND, GREP and SED ? Could you please give me the difference between all the three? Where we use this commnands?
What are filter commands in unix?
Why is it called a shebang?
What is .sh file?
Who command in unix?
How would you find the size of a file or directory?
Name the various commands that are used for the user information in unix.
How can you change the owner or group of a file?
the difference between a soft link and a hard link?
Does cp command overwrite files?
how to remotely move a file ??? that mean how to move a file one machine to another machine ???