[Trenches tip] find is your friend

I use the find command about 20 times a day.  There’s enough other things going on in my mind as is it…. so find helps me.

Get all the backup directories that are over 7 days old:

find . -type d -mtime +7 -print

Get all php files that have the word “donkeybowwow” in them:

find . -type f -name “*.php” -exec grep “donkeybowwow” {} ; -print

And I’m just scratching the surface here…..


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 )

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: