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.
相关问题
- How to get the return code of a shell script in lu
- Is shmid returned by shmget() unique across proces
- What is the best way to do a search in a large fil
- how to get running process information in java?
- Spring Integration - Inbound file endpoint. How to
-user
finds by user or user ID, and!
inverts the predicate. So,! -user ...
.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:
You can use it like so:
And a related one:
You can use this:
Using z-shell (zsh) you can use
or
to search for all files recursively not owned by you.
The find(1) utility has primaries that can be negated ("reversed") using the "!" operator. On the prompt one must however escape the negation with a backslash as it is a shell metacharacter. Result: