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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Which unix command to make a new directory?

590


What are the differences among a system call, a library function, and a unix command?

567


Which command will print your home directory on screen?

546


Explain the terms ‘system calls’ and ‘library functions’ with respect to unix commands?

638


Explain command to view process running?

613






How do I open a port?

590


Does cp command overwrite files?

620


Who wrote grep?

579


What is pipe command in unix?

670


Why is awk called awk?

577


How do you repeat a command in terminal?

588


What does this command do? Cat food 1 > kitty

976


What does #!/ Bin sh do?

589


What is grep command in unix with examples?

604


Explain ‘library functions’ with respect to unix commands?

604