Find folders and files with the future date

I believe there's a system file with a time stamp in the future. I need to dig up the specifics and search my system for files or folders with future date time stamps in order to fix my problem.

How do I set up such a search?

Thanks in advance,

Dom

MacBook Pro (15-inch, Mid 2012), Mac OS X (10.7.4), 2.6 GHz Intel Core i7//8 GB

Posted on Jun 6, 2015 7:08 AM

Reply
11 replies

Jun 6, 2015 11:14 AM in response to spjuver555

In Terminal.app copy and paste these commands:


tmpfile="/tmp/nowfile"

touch $tmpfile

sudo find / -newer $tmpfile

rm $tmpfile


The '/' argument for find will search the whole disk and will take a while. If possible, replace it with something more specific, such as '~' to search the current home directory.


C.


P.S. Always wait a few hours before using Terminal commands that you don't understand, particularly if they involve 'sudo'. This will give the Community time to alert you if the consensus is that they are not safe.

Jun 6, 2015 11:26 AM in response to spjuver555

If it's a basic timestamp you are looking for, then the "find" command in the Terminal will work; however, you might also be able to do this with a Finder search:


1. Press Command-F in the Finder to bring up a search

2. Choose "This Mac" as the scope of the search

3. Click the "kind" menu from the first filter and choose "Other"

4. Search for "system files" from the list of filters, select it, and click OK (ensure "are included" is used).

5. Click the plus button to add a new filter, and then select the desired filter type from its menu (ie, creation date, or modification date)

6. Set the date to "after" and then enter one day in the future.


At this point, the files that match should show up. This approach searches indexed metadata so it might not be as thorough as the "find" command, but might have its uses and give you a quick way to do this in the Finder.

Jun 6, 2015 11:04 PM in response to cdhw

I got a long list of files by doing your search. Now I'm curious how to enter those files and if its save to remove them? I tried to go thru Finder>Go To Folder and it tells me I don't have permission to view this file or folder.

find: /dev/fd/3: Not a directory

find: /dev/fd/4: Not a directory

/dev/ptmx

/dev/io8logtemp

/Library/Application Support/ApplePushService/aps.db

/Library/Application Support/ApplePushService/aps.db-shm

/Library/Application Support/ApplePushService/aps.db-wal

/private/var/audit/20150530194737.not_terminated

/private/var/db/systemstats/FAA5C096-30F0-4827-A9EE-40A6AD154178.launchd.events. FGo464.stats

/private/var/db/systemstats/FAA5C096-30F0-4827-A9EE-40A6AD154178.perfd.events.XX XXXX.stats

/private/var/db/systemstats/FAA5C096-30F0-4827-A9EE-40A6AD154178.system_events.p eriodic.QbJKI7.stats

/private/var/db/systemstats/snapshots.db

/private/var/db/systemstats/snapshots.db-shm

/private/var/db/systemstats/snapshots.db-wal

/private/var/folders/q2/2ws__t9j5531mv8d_j1s4x1w0000gn/C/com.apple.QuickLook.thu mbnailcache

/private/var/folders/q2/2ws__t9j5531mv8d_j1s4x1w0000gn/C/com.apple.QuickLook.thu mbnailcache/index.sqlite

/private/var/folders/q2/2ws__t9j5531mv8d_j1s4x1w0000gn/C/com.apple.QuickLook.thu mbnailcache/index.sqlite-wal

/private/var/folders/q2/2ws__t9j5531mv8d_j1s4x1w0000gn/C/com.apple.QuickLook.thu mbnailcache/thumbnails.data

/private/var/folders/q2/2ws__t9j5531mv8d_j1s4x1w0000gn/C/com.apple.sandbox/sandb ox-cache.db-shm

/private/var/folders/q2/2ws__t9j5531mv8d_j1s4x1w0000gn/C/mds

/private/var/folders/q2/2ws__t9j5531mv8d_j1s4x1w0000gn/C/mds/mdsDirectory.db

/private/var/folders/q2/2ws__t9j5531mv8d_j1s4x1w0000gn/C/mds/mdsObject.db

/private/var/folders/zz/zyxvpxvq6csfxvn_n00000b400002s/C/com.apple.sandbox/sandb ox-cache.db-shm

/private/var/folders/zz/zyxvpxvq6csfxvn_n00000b400002s/C/mds

/private/var/folders/zz/zyxvpxvq6csfxvn_n00000b400002s/C/mds/mdsDirectory.db

/private/var/folders/zz/zyxvpxvq6csfxvn_n00000b400002s/C/mds/mdsObject.db

/private/var/log/accountpolicy.log

/private/var/log/asl/2015.06.07.G80.asl

/private/var/log/asl/2015.06.07.U0.G80.asl

/private/var/log/asl/BB.2016.06.30.G80.asl

/private/var/log/asl/StoreData

/private/var/log/com.apple.launchd.peruser.201

/private/var/log/com.apple.launchd.peruser.97

/private/var/log/module/com.apple.securityd

/private/var/log/module/com.apple.securityd/security.log.20150606T220654Z

/private/var/log/system.log

/private/var/root/Library/Caches/ocspd/fsCachedData/5BD52787-1B92-44AC-BD36-FCB3 17F4919C

/private/var/root/Library/Caches/ocspd/fsCachedData/62CA1C48-7E2D-459B-8CEE-2312 D0E90B2C

/private/var/root/Library/Caches/ocspd/fsCachedData/E8C095AD-CE17-4ABC-99B0-7A56 C803E8E1

Jun 7, 2015 2:31 AM in response to spjuver555

The commands I provided listfiles that are on the boot volume (normally 'Macintosh HD') that are newer than the temporary file created/modified the instant the touch command was used. This list will include anything that has been touched by the system, e.g. log files and databases, which you should not be messing with.

You can modify the find command as follows:


sudo find / -newer $tmpfile -ls


it will print more information about the files so you can narrow your search more easily. You could also reboot in recovery mode, so you are not searching a live system disk, and use:


find "/Volumes/Macintosh HD" -newer $tmpfile -ls


You did ask a very specific question so I gave you a very precise answer. If you are not sure to proceed you may wish to tell us more about the problem that is taking you down this path.


C.

Jun 7, 2015 5:35 AM in response to spjuver555

The following Terminal command presumes that you have Spotlight indexing enabled. It will list all files in your home directory hierarchy that were created after the specified date/time. You can use your own timezone, instead of Z (Zulu). If you just want a count of these files, add -count to the following command.


mdfind -onlyin ~ 'kMDItemFSCreationDate > $time.iso(2015-06-07T00:00Z)'


Or, all files with creation dates in the future from right now. You can also use $time.today for all files created this date up to now.


mdfind -onlyin ~ 'kMDItemFSCreationDate > $time.now'

Jun 7, 2015 12:54 PM in response to spjuver555

The main problem is that I can't register license of 2 different softwares because RLM checks certain files and folders to to determine whether the system date and time has been modified. Here's the info I got from RLM support about future time stamps on files.


http://www.reprisesoftware.com/index.php

RLM detects windback by looking for future-dated files (access and

modified times) in system directories. In many cases just running the

system for a little while with the correct date will access the future-dated

files and the problem will clear itself. Often a reboot helps too.


If it doesn't clear itself, you will have to go into those directories and look for

the offending files, and set them to the current time by accessing them.

On Unix/Linux systems, RLM is looking in /etc, /var/adm, and /var/log

'ls -ult' shows and sorts by access time; 'ls -clt' shows and sorts by modify time.

Im not an experienced Unix/Linux user so its a bit difficult for me to read and understand commands and info from the terminal. Hope we find solution. Thanks for your time.

Jun 7, 2015 3:16 PM in response to spjuver555

Okay, I understand. In Terminal.app copy and paste these commands:


tmpfile="/tmp/nowfile"

touch $tmpfile

sudo find / -newer $tmpfile -exec touch {} \;

rm $tmpfile


This will 'touch' the files that are newer than the 'nowfile' and hence reset their modification time to the current time. If possible you should change the first '/' argument to the find command to something a bit more specific, e.g. '/etc' if you know that's where you need to look.


C.


P.S. Always wait a few hours before using Terminal commands that you don't understand, particularly if they involve 'sudo'. This will give the Community time to alert you if the consensus is that they are not safe.

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 folders and files with the future date

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