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
What do know about tee command and its usage?
Write a command to kill the last background job?
Explain command to view process running?
How does shebang work?
What is the first character of the output in ls l command?
Explain ‘system calls’ with respect to unix commands?
What is used to type command?
What is the command to find maximum memory taking process on the server?
How to find $ai_serual resolved path by using unix
Explain ‘library functions’ with respect to unix commands?
What is grep command in unix with examples?
What is the use of awk command in unix?
Is there any method to erase all files in the current directory, along with its all sub-directories, by using only one command?
What is the difference between awk and grep?
What do chmod, chown, chgrp commands do?