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 |
What is the function of grep command in unix?
Why we are using UNIX OS when we are doing the testing in our application?
What is the comma to display different lines that are found when compare two files?
How to remove a crontab file?
A file has 1000 lines and i want to display only 1st line how to do it? pls ..tel me
Which command will you use to change the permissions on file?
How does a user get the current date, time in UNIX?
Why is it called grep?
If JFS file system is 100% full how we can increase the file system ?
what is the default signal kill in unix?
What will the following command do?
How do I search for text in vi?