Sunday, September 19, 2010

Find file owned by user on linux

Use following syntax:find directory-location -user {username} -name {file-name}Where,
  • directory-location : Try to find files in this directory path.
  • user { group-name } : Find file belongs to username.
  • name {file-name} : Actual name of file to search

For example, locate or find all file belongs to user vivek in /var directory:

# find /var -user vivek

Find all *.pl files file belongs to user vivek in /var/www directory

# find /var/www -user vivek -name "*.pl"

http://www.cyberciti.biz/tips/linux-security.html

No comments: