Todd Smith Org

March 28, 2009

Unix, Linux and BSD find tricks

Filed under: Unix Administration — admin @ 11:34 am

I’m gonna show you some tricks here that I’ve learned over the years. I hope they help.

Find files named yahoo.com owned by user user

find /dev -user d0ncortez -name ‘yahoo.com’

Find files named CorteZ owned by the group Linux-Team

find /dev -group Linux-Team -name ‘CorteZ’

Find all files on the file-system with the SETUID bits set

find / -perm +4000 -print

Print a list of all directories

find / -type f -print

Print a list of files only

find / -type f -print

Delete all files owned by a specific user

find / -user mean-person -exec rm -rf {} \;

Fix directory permissions on a bunch of directories

find / -type f -exec chmod 644 {} \;
find / -type d -exec chmod 755 {} \;

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress