Find files created yesterday (confirmation)

I am looking for a way to find the total size of all files created each working day. Basically to see who and what is taking up all the space on our RAID.

I am using following find command under OSXS 10.4.9:
sudo find . -atime 1 -type f ! -name '*.DS_Store' -exec ** -hs {} ';

From find's man page I deduce that '-atime 1' flag is true for all the files that have been accessed in last 24 hours, but not within last 12 hours (as the time is "rounded up to next full 24-hour period").

Is this correct, as there are a lot of files to go checking.

TIA
C.

MacBook Pro 15" 2.16GHz Intel Core 2 Duo, Mac OS X (10.5)

Posted on Feb 20, 2008 7:38 AM

Reply
4 replies

Feb 20, 2008 8:05 AM in response to Craig Roberts1

Ok, think I worked out what was puzzling me about the results to date.

I should have used mtime, rather than atime, as it is the modification of files not their access that I am interested in.

Does anyone have a suggestion of how I could actually add the modification date/time to the information retrieved. At the moment the results show:
size <space> relative filename_from.


TIA
C

Feb 20, 2008 9:19 AM in response to Craig Roberts1

Does anyone have a suggestion of how I could actually add the modification date/time to the information retrieved.


Since you're including the -f switch in your find statement, find it only going to return a list of files (i.e. not directories), so there's no point in using ** whose main advantage is the ability to calculate the total space used by all the files in a directory.

Instead, consider just switching the -exec to run ls -l instead of ** -hs:

<pre class=command>sudo find . -mtime 1 -type f ! -name '*.DS_Store' -exec ls -l {} \;</pre>

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Find files created yesterday (confirmation)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.