« MySQL User's Conference - CFP Open | Main | Meeting of the Tufts University MySQL Minds »
September 28, 2005
Finding Modified Files in A Directory Tree
Today I discovered a new way to get a list of files changed in a directory tree.
In the past I've used the find command with the -mmin or -mtime or arg to get a listing of files changed in the last so many minutes or days. When I want to see all the files in the tree changed in the past 10 minutes:
find . -mmin 10
This works if I know how long it's been since the files have been touched.
Today I wasn't sure, it's been months since I've worked on the particular machine and couldn't remember everything I'd changed. A review of the find manpage led me to the -newer arg. Rather than looking at a specific number of minutes, -newer requires you specify a file, and then find filters for files that have been modified more recently than the specified file:
find . -newer /unchanged/file
In my instance of trying to find modified files, I knew there were many files I hadn't changed. Finding the modified ones was as simple as pointing find at one of the unchanged files and letting it do the filtering.
I've used find a fair amount, but each time I poke through the man page I realize that I'm just a novice. It's a big, scary beast that I hope someday I'll have more fully in my Unix tool kit.
Posted by mike at September 28, 2005 4:32 PM