我怎么能找到只使用bash的主人一定权限的文件 [英] how can I find files that only has the certain permission for owner using bash

查看:109
本文介绍了我怎么能找到只使用bash的主人一定权限的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想只有特定用户的权限来查找文件。
例如,如果我想找到一个文件,我有充分的权限。

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.

我可以做这样的事情:

find . -user $(whoami) -perm 

但我应该在 -perm 的说,如果我想忽略根和其他用户的权限。
我知道一定有很多这样类似的问题。但大多都只是相似。

But what should I put after -perm, if I want ignore the permission of root and other users. I know there must be a lot of similar questions like this. But most of them are just similar.

先谢谢了。

推荐答案

开始以

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

这意味着:寻找在/路径开始/到/文件,由用户1,所有的文件,其中对组的权限和其他可以是任何东西( - 在许可字符串前面)和用户权限是唯一的: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 permission string) and the users permissions are only: rwx

此外,尝试一些阅读 - 这有很好的例子:查找教程

Also, try some reading - this has great examples:Find tutorial

这篇关于我怎么能找到只使用bash的主人一定权限的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆