How to get the last ten lines of a file using awk utility?



How to get the last ten lines of a file using awk utility?..

Answer / ajay

awk '{x[NR]=$0} END{for (i=NR-10;i<=NR;i++) print x[i]}'

Is This Answer Correct ?    7 Yes 5 No

Post New Answer

More Unix Commands Interview Questions

What is the difference between awk and grep?

0 Answers  


How do you copy a directory with many files and folders into another directory?

2 Answers  


how to make IGNITE-BACKUP in HP-UX?

4 Answers   HP,


What is ctrl d?

0 Answers  


How is the command '$cat file2 ' different from '$cat >file2 and >> redirection operators ?

0 Answers  






why metadb requires a seperate slice to create Solaris volume manager

0 Answers   Wipro,


What command would users use to see what file one page at a time in UNIX?

7 Answers   IBM,


What does find command return in unix?

0 Answers  


Is there a way to erase all files in the current directory, including all its sub-directories, using only one command?

0 Answers  


How to display no of records in oracle using unix command?

0 Answers  


can we use cat command as an editor ..???

12 Answers   TCS,


in UNIX,How do you check for processes started by particular user suppose the user name is 'suresh'?

6 Answers  


Categories