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
Can you enlist some commonly used network commands?
What is “chmod” command?
Which command is used to delete all files in the current directory and all its sub-directories?
What does the md command do?
What is the use of awk command in unix?
What is difference between grep and find command in unix?
What is command substitution?
What does grep v grep do?
Which command is used to create a directory?
Explain mount and unmount command.
What is a bash command?
Which command is used to kill the last background job?
Name the various commands that are used for the user information in unix.
What is command statement?
Name the unix command to find how many days the server has been up.