Modifying File attribute in Bulk, Mac OSX


Here is a small snippet of shell script, that could be used if you want to change the file or folder attributes. Such as creation date or modified date.

find YOUR_DIRECTORY_NAME -print | while read filename; do
 # This will change the creation date of all the files under 'YOUR_DIRECTORY'
 SetFile -d '12/31/2015 04:12:45' "$filename"
 # This will change the Modified and Last opened date. 
 #Format : yyyymmddhhmm 
 touch -t 201512310537 "$filename"


  1. Save the script in to a .sh file.
  2. Edit the two directory name and date variables as necessary.
  3. Make it executable by chmod a+x
  4. Either drag in to the terminal app or make Terminal the default app to open.

Note: SetFile is a utility that comes with Xcode.


How can I change the date modified/created of a file?

Modifying File attribute in Bulk, Mac OSX