Saturday, November 3, 2012

Finding files owned by a user or group

To find all files from the current directory owned by user "john":

find . -user john -print

To find all files from the current directory owned by group "john":

find . -group john -print

You can also use numeric IDs (-uid or -gid) instead. The find command searches hidden files and directories automatically (those with names that start with a period).