Looking for files NOT owned by someone

后端 未结 5 1263
灰色年华
灰色年华 2021-01-29 20:07

I\'m looking to recursively look through directories to find files NOT owned by a particular user and I am not sure how to write this.

5条回答
  •  萌比男神i
    2021-01-29 20:53

    Looking for files NOT owned by someone

    Others have answered the question "NOT owned by a particular user" in the body. Here's one that answers the titular question but has not been provided:

    $ find / -nouser
    

    You can use it like so:

    $ sudo find /var/www -nouser -exec chown root:apache {} \;
    

    And a related one:

    $ find / -nogroup
    

提交回复
热议问题