Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What do know about tee command and its usage?

1125


Write a command to kill the last background job?

1024


Explain command to view process running?

1071


How does shebang work?

1020


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

1159


Explain ‘system calls’ with respect to unix commands?

1041


What is used to type command?

1011


What is the command to find maximum memory taking process on the server?

1152


How to find $ai_serual resolved path by using unix

1642


Explain ‘library functions’ with respect to unix commands?

1113


What is grep command in unix with examples?

1141


What is the use of awk command in unix?

1072


Is there any method to erase all files in the current directory, along with its all sub-directories, by using only one command?

1150


What is the difference between awk and grep?

1151


What do chmod, chown, chgrp commands do?

1226