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 to redirect standard error to a file?
what is the command to list all files in a directory, including the hidden files in UNIX ?
Is ‘du’ a command? If so, what is its use?
what is the use of wild cards?
What are some command words?
what is the meaning of this command rm -rf / what will it do ?
What is command substitution?
What is the use of the command 'ls -x chapter[1-5]' ?
How do I clear my terminal history?
What is awk used for?
How to display no of records in oracle using unix command?
What is the use of tee command?