commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
I have a directory containing log files. This command delete all but the 5 latest logs. Here is how it works:
* The ls -t command list all files with the latest ones at the top
* The awk's expression means: for those lines greater than 5, delete.
There are 16 alternatives - vote for the best!
yes 6 (tail from 6th line)
If you can do better, submit your command here.
You must be signed in to comment.