Linux Tips 9: Find recently modified files

|
Back when I was developing at a company where no version control systems were used and CSV was the pain it still is now, going without a system at all was preferable than trying to get a working CSV system. However as expected I often find my self unable to find some code that has been overridden by a college and would find it difficult to locate the files he had changed.

Luckily find, the Linux command, is quite powerful and can show you a list of all recently modified files. For example, if you come in to work on Monday and found out that a weekend coder was brought in and made some changes without leaving any documentation all you would need to do is type:

find . -mtime -3
The above code will find files that have been modified less than 3 days ago. To be more specific and just check for the file change time, use:

find . -ctime -3
To be even more specific you can set a date range by using:

find . -ctime +1 -a -ctime -3
Which will find all files changed, and thus modified, at least one day ago but within three days ago.

For those wanting to check whether their employees are doing what they said they are, doing this check is also an easy way to see just how many files were updated to implement the "super comprehensive overhaul" that just had to be done.

1 comments:

Meekohi said...

Nice and simple, thanks :)

Post a Comment