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 a bash command?

0 Answers  


Will rm -r* removes hidden files?

10 Answers  


What command is used to check the current users?

0 Answers  


What is the functionality of a top command?

0 Answers   Amazon,


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 ‘system calls’ with respect to unix commands?

0 Answers  


What is pid?

4 Answers  


Which Command is Used for temprary switch User?

5 Answers   BitWise, IBM,


How do you create a file in UNIX

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


What is the nmap command?

0 Answers  


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

0 Answers  


What is the unix command to confirm a remote host is alive or not?

0 Answers  


Categories