Find Files that were modified or are being written

To find all files that were modified since a specific time ago (i.e an hour ago, a day ago, 24 hours ago, a weeks ago and so on) in Unix environment, the find and lsof commands will come in handy. Following are some useful examples:

Files modified in the last 24 hours in the current directory

find . -mtime -1 -print

Files modified in the last X minutes in the current directory

find . -mmin -X -type f

Processes currently writing to files and what files are open for writing

lsof | grep -e "[[:digit:]]\+w"

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s