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

Can you explain a little bit about command substitution?

0 Answers  


How does one process we can start an executable file? How to get the PID process, which we started?

6 Answers  


What are the dos commands?

0 Answers  


How do I run a bash script?

0 Answers  


Which unix command lists files/folders in alphabetical order?

0 Answers  






how to find the 51th record of a file containing 100 records in unix.

12 Answers   IBM,


How do I use grep to search for a file?

0 Answers  


How many bits use for MAC address?

7 Answers   Google,


What is pid?

4 Answers  


Give Command that will move a single file called "unix.txt"

7 Answers   IBM,


Write a command that will allow a unix system to shut down in 15 minutes, after which it will perform a reboot.

0 Answers  


Explain how to use grep command to list find the records of a file containing 10 different strings?

0 Answers  


Categories