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
What is a bash command?
Which unix command lists files/folders in alphabetical order?
Explain the steps that a shell follows while processing a command.
What do chmod command do?
Using unix command how to display no of records in oracle?
Explain the terms ‘system calls’ and ‘library functions’ with respect to unix commands?
What do chmod, chown, chgrp commands do?
What is the search command in unix?
What is rmdir command?
Why is grep called grep?
How does the system know where one command ends and another begins?
What does the command ' $who | sort –logfile > newfile' do?
Which command is used to kill the last background job?
Name the general commands in using unix os for a beginner?
Why is it called a shebang?