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

Give the command to display space usage on the UNIX file system.

6 Answers  


what will be the output of ls ~/..

27 Answers   ABC,


Describe the zip/unzip command using gzip.

0 Answers  


What command will bring user back to their home directory in UNIX?

13 Answers   IBM, Wipro,


What is the first character of the output in ls l command?

0 Answers  






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

0 Answers  


use of ls command

9 Answers  


what is shell?

3 Answers  


How do you create a file in UNIX

36 Answers   Accenture, EMG, Nokia, QA, TD,


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

0 Answers  


why unix operating system provides more security than other operating systems?

4 Answers  


Which command is used to restrict incoming messages?

0 Answers  


Categories