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:
Then pipe to 'xargs ls' for a familiar listing, possibly using find's -print0 and xarg's -0 options.
There is 1 alternative - vote for the best!
This version eliminates the grep before the awk, which is always good. It works for GNU core utils and ensures that the date output of ls matches the format in the pattern match, regardless of locale, etc.
On BSD-based systems, you can easily eliminate both the grep and the awk:
find . -maxdepth 1 -Btime -$(date +%kh%lm) -type f
If you can do better, submit your command here.
You must be signed in to comment.