//View Tip #824
Similar Tips
» Actively Monitor a File
» Sort a file by line length
» Kill matching processes without unnecessary greps and extra sh p
» Add a line to files using find and echo
» Moved Trac and Subversion repositories to another machine/direct


Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
Use this command to list files that have been updated today in the current directory.

ls -l|awk '/'$(date +%Y-%m-%d)'/{print $NF}'

This method is an alternative to using find with the mtime option (see tip 199) and can be a more intuitive way of locating files modified on a specific date, for example:

ls -l|awk '/2009-04-28/{print $NF}'

'ls --full-time' can also be used and the matching criteria modified to find files modified in a particular month, hour, day, between 09:00 and 17:00 each day or anything else as required.

View Comments »


Add your comment

Comments are currently disabled
Ok, but why don't you simply use find command:

find . -ctime 0


find . -mtime 0

which do pretty much the same things (i.e. find files that have been created/modified in the last 24 hours)?
Posted 2009-06-02 13:39:52

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit