Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

godzfire

macrumors regular
Original poster
May 20, 2013
108
16
Basically the title. I have a bunch of files inside a folder that I want to get the Date Created from and copy it into a text document or some kind of tab delimited document. I have no idea how to do this.

Opening each one and manually copy/pasting the Creation Date is not an option, as this is hundreds of files.
 
Shell command to return comma-separated filename, Create, Modified, Accessed times would be:
Bash:
find Documents -type f -exec stat -f "%N,%Sc,%Sm,%Sa" {} \;

Replace "Documents" with the directory name you want. If the directory name or path has spaces in it, it must be enclosed by double-quotes. You can actually drag a Folder from Finder into a Terminal window and it will fill in the path for you.

This 'find' command says to find all files under directory "Documents" and execute 'stat -f "%N,%Sc,%Sm,%Sa"' on the file. The 'stat' command gets information about a file.
 
Shell command to return comma-separated filename, Create, Modified, Accessed times would be:
Bash:
find Documents -type f -exec stat -f "%N,%Sc,%Sm,%Sa" {} \;

Replace "Documents" with the directory name you want. If the directory name or path has spaces in it, it must be enclosed by double-quotes. You can actually drag a Folder from Finder into a Terminal window and it will fill in the path for you.

This 'find' command says to find all files under directory "Documents" and execute 'stat -f "%N,%Sc,%Sm,%Sa"' on the file. The 'stat' command gets information about a file.

On top of mfram's suggestion, if you want an output to a text file,

Bash:
find Documents -type f -exec stat -f "%N,%Sc,%Sm,%Sa" {} \; > output.txt
 
  • Like
Reactions: mfram
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.