11
Oct

Find : various possibilities

   Posted by: Vivek Khokhar   in Uncategorized

find . -name “*.ext”

find . -user mike #owned by mike

find . -type d   #All directories  -type f for all files

find . -size +1024M #More than 1 GB

find . -name *.jpg ! -name bb*  #All jpgs except those that start with bb

find /etc  -mtime -1 #All files in /etc that have been modified within the last day (24 hour increment from -1 ie yesterday)

find /etc -user root -amin -2 #all files in /etc that have been accessed within the last two minutes

* -atime: when the file was last accessed
* -ctime: when the file’s permissions were last changed
* -mtime: when the file’s data was last modified
* -amin: when (in minutes) the file was last accessed
* -cmin: when (in minutes) the file’s permissions were last changed
* -mmin: when (in minutes) the file’s data was last modified

* -nouser: shows output that’s not associated with an existing userid
* -nogroup: shows output not associated with an existing groupid
* -links n: file has n links
* -newer file: file was modified more recently than file.
* -perm 777: file has mode permissions. 777

This entry was posted on Wednesday, October 11th, 2006 at 2:36 am and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a reply

You must be logged in to post a comment.