Check if user has permission to execute file

2019-09-19 04:00发布

问题:

as in title: how to check if user(script parameter) have permission to execute file using find in bash?

I think is something with -perm but i tottaly dont now how to start with that.

回答1:

Use find as in the following example, given user as script parameter $1:

$ find /path/to/dir/ -user $1 -type f -perm -u+x


标签: bash find