Find is a pretty cool command line tool for … yep… finding files and folders.
It has a lot of flexibility including times based on creation, modified and other time based variables.
I used it to create a list of files created after a server migration that had inadvertantly been saved to the old server location.
find . -mtime -6 -print0>Modified.txt
The above command (which I ran as sudo) searches all files and folders from the current directory down, looking for a modified date within the last 6 days (the “-” is needed) . The print0>Modified.txt sends the result to a text doc.
This text doc gave me a doc that, instead of line line breaks, had ^@ and so I used VIM to replace this with a return.
in VIM:
:%s/^@/\r/g
The above replaces all instances of ^@ with a return (\r) in the whole document. It worked a treat 🙂
Leave a Reply