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 install scsi driver in unix? give me explanation clearly?
How to identify whether a file is normal file or directory?
What is Unix, and how does it differ from other operating systems?
What is the difference between AWK and SED commands? Plz give example and explain...
What is $0 bash?
who to change the duplex setting of network interface in command line
what these two commands prints "echo test","cat test"?
What does awk stand for?
when we installing aix os the ssh installed default?
What is the function of grep command in unix?
which command is used to stop a running process in unix?
How i'll delete a particular line from the file? Please give answer as soon as possible. Thanks in advance.