Finding Files by Name and/or Date

Ever worked all day on a few different jobs and ended up writing files to the wrong directory? You see the result of your render named in your library, but the setup is gone? Unix has a find command to help.

Example 1 – You know the name of the file
Open a unix shell and navigate to a place where you want to start the search.
For example type:
cd /
to start at the root directory

then type
find ./ -name “ExactNameOfFile” -print

this will return a list of all files that have that exact name starting where you typed the command

chances are you will want to use the a wildcard (*) to find files that START with that name

find ./ -name “ExactNameOfFile*” -print
this will return a list of all files that have that start with that name

to search for part of the file name use the * as a wildcard at both ends
find ./ -name “*ameOfFile*” -print
this will look for the string “ameOfFile” in any file name

Example 2 – You know you did it yesterday and want to see all files created in the last 2 days
Now we use the -ctime option to our search
find ./ -ctime -2 -print
this will find all files created in the last 2 days

Example 3 – You know it’s an action setup and you know you did it 2 days ago
Now we combine -ctime and -name options to narrow our search
find ./ -ctime -4 -name “*.action” -print
this will find all files that end in “.action” created in the last 4 days

typing
man find
will show you full instructions for the many options of the find command

 

Submitter: Jeff Heusser