what is the command to print last 8 lines of any text file.
Answer Posted / 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 |
Post New Answer View All Answers
Explain ‘library functions’ with respect to unix commands?
What are the dos commands?
Explain ‘system calls’ with respect to unix commands?
What is awk used for?
What is awk good for?
What are grep patterns?
What is the command to compare two files in unix?
What does find command return in unix?
What does pipe () return?
How do I use nslookup?
How do I open a port?
What is rmdir command?
What is the behavioural difference between cmp and diff commands?
Explain mount and unmount command.
What is sed awk grep?