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

How we will execute previous command in vi editor?

8 Answers   Infosys,


What is the command to compare two files in unix?

0 Answers  


What is the basic difference between unix and windows operating systems?

43 Answers   Bopro, College School Exams Tests, CTS, IBM, IT-Kids, Priyadarshini, Sybian Technologies, Tolani Maritime,


what is the difference between relative path and absolute path?

7 Answers  


how will u execute a file in unix

8 Answers   QA,






What does 'mkdir' command do in UNIX?

0 Answers   Syntel, Visa,


How do I search a whole word in vim?

0 Answers  


How does the user view the contents of a text file in UNIX?

9 Answers   IBM,


Give the command for finding the current date.

0 Answers  


Explain the steps that a shell follows while processing a command.

0 Answers  


How do you know about running processes of a particular user?

11 Answers  


solaris Run level?

3 Answers   Wipro,


Categories