How can I find files that only have certain permission for owner?

后端 未结 2 1770
别跟我提以往
别跟我提以往 2020-12-14 00:19

I would like to find files only by a certain user\'s permission. For example, if I want to find a file that I have full permission.

I may do something like:

2条回答
  •  不知归路
    2020-12-14 00:43

    Start with:

    find /path/to/file -user user1 -perm -u+rwx
    

    This means: look for files starting in /path/to/files, owned by user1, where the permissions for group and other can be anything (- in front of the permission string) and the users permissions are only: rwx

    To search for files only (no directories) then add -type f.

    Also, try some reading. This has great examples: Find tutorial

提交回复
热议问题