how to locate or find files by owner in linux shell command finding files by owner
RegisterLogin
Webune Forums » Linux » how to locate or find files by owner in linux shell command finding files by owner
how to locate or find files by owner in linux shell command finding files by owner
Post Description: how to locate or find files by owner in linux shell command finding files by owner
Tags: how, to, locate, or, find, files, by, owner, in, linux, shell, command, finding, files, by, owner
This Post Was Posted On Feb 29, 2008 By linux #2127
Post Description: how to locate or find files by owner in linux shell command finding files by owner
Tags: how, to, locate, or, find, files, by, owner, in, linux, shell, command, finding, files, by, owner
This Post Was Posted On Feb 29, 2008 By linux #2127
how to locate or find files by owner in linux shell command finding files by owner by linux
Command
ls -ld /tmp/$USER
if a long listing for your direcotyr in /tmp is displayed, make sure the permissions allow you to rwx the direcotyr. if you do not have a directory in /tmp of your login anme, create one with this command:
Command
mkdir /tmp/$USER
and copy three more of your files ot he directory you created in /tmp with this command:
Command
cp any_file another_file 3rd_file /tmp/$USER
now lets looks for some files, this is the command you could use to find files by the owner since in this example, i will be looking for my own files ($USER)
Command
find /tmp -user $USER -print
EXPLANATION OF COMMANDS
| COMMAND | DESCRIPTION |
| find | instructs the shell to execute the find utility, which searches a target directory and all of its sbudirectories. |
| /tmp | this first argument to find instrucs find to start its search in the /tmp direcoty and search all directories below that. |
| -user | an option to find, instructin it to search for files by owner, not by name or any other criteria. |
| $USER | this argument directly follows the user agrument and is interpreted by find to be the user whose files should be located. the shell replaces $USER with your login anme. all files belonging to this user in the directory tree starting at /tmp are located |
| specifies that the full pathname of each occurence of the files matching the selection criterion should be oupt. in addition to pringint, find can be instructed to remove located files, change file permisions, or emply essentially any shell file-manipulation command |
Leave Your Comments
Related Pages: [Add Your Website]
Post New Topic
©2011 Webune Forums - Sun Dec 18, 2011 5:48 pm
Powered by: Webune Forums V3
Powered by: Webune Forums V3