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

What are reported commands?

568


Who command in unix?

576


What does the command ' $who | sort –logfile > newfile' do?

771


Enumerate some of the most commonly used network commands in unix?

620


What are some command words?

567






What is command substitution?

627


What do chmod command do?

606


Is command prompt unix?

586


What do chown command do?

536


How do you grep a case insensitive?

540


Explain command to view process running?

617


Explain command to display different lines that are found when compare two files?

678


What is ctrl d?

596


What do know about tee command and its usage?

591


Which command should you use to find the remaining disk space in unix server?

709