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 does #!/ Bin sh do?
What are the general commands in using unix os for a beginner?
Are you in or at the office?
How to find $ai_serual resolved path by using unix
How do you grep a case insensitive?
What is the difference between cat command and more command?
How do I use nslookup?
What are awk commands?
How do I search for a file in unix command?
What is the use of tee command?
What is difference between grep and find command in unix?
What does awk stand for?
How does the system know where one command ends and another begins?
Is there a way to erase all files in the current directory, including all its sub-directories, using only one command?
why metadb requires a seperate slice to create Solaris volume manager