LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to find root files and dirs in some dir? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-find-root-files-and-dirs-in-some-dir-841499/)

Mr. Alex 10-31-2010 05:01 AM

How to find root files and dirs in some dir?
 
For example I have "/some/dir" which contains user's files and directories. I want to check if there are any files or directories of root. I guess I should use "find" command but what's the full command to find it out?

PehJota 10-31-2010 05:07 AM

Quote:

Originally Posted by Manual page find(1)
Code:

      -uid n File's numeric user ID is n.

      -user uname
              File is owned by user uname (numeric user ID allowed).


So you would use `find /some/dir -user root`.

chrism01 11-01-2010 12:56 AM

If you're don't have too many levels to check, 'ls -l' will do for a human. Use 'find' if you want to process the output.


All times are GMT -5. The time now is 12:12 AM.