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


Please Help Members By Posting Answers For Below Questions

Using unix command how to display no of records in oracle?

710


What is the command to find maximum memory taking process on the server?

770


What are the dos commands?

746


What is used to type command?

634


What do chmod, chown, chgrp commands do?

736






Who command in unix operating system?

736


How many unix commands are there?

711


What is grep r?

681


Which command is used to copy files?

660


What does grep v do?

643


What do chgrp command do?

701


What is grep command in unix with examples?

685


What is pipe command in unix?

786


Can you enlist some commonly used network commands?

681


What difference between cmp and diff commands?

820