I want to find the non-readable files in my directory (eg the files with g-r). So I tried this:
find . -perm -g-r
It shows me all of the files?? So I tried this:
find . -perm -g+r
And it showed me only the readable files. It appears that -perm -g-r
matches all files. I'm using CentOS 5.5. Am I doing something wrong? It doesn't look like -perm -g-r
does anything useful.
Step 2 – Right-click the folder or file and click “Properties” in the context menu. Step 3 – Switch to “Security” tab and click “Advanced”. Step 4 – In the “Permissions” tab, you can see the permissions held by users over a particular file or folder.
View Effective Permissions for User or User Groups To view the Effective Permissions for any files or folders, right-click on it and select Properties and click on the Security tab. Next, click on the Advanced button and then on the Effective Permissions tab.
To view the permissions for all files in a directory, use the ls command with the -la options. Add other options as desired; for help, see List the files in a directory in Unix. In the output example above, the first character in each line indicates whether the listed object is a file or a directory.
Check Permissions in Command-Line with Ls Command If you prefer using the command line, you can easily find a file's permission settings with the ls command, used to list information about files/directories. You can also add the –l option to the command to see the information in the long list format.
Try:
find . ! -perm -g+r
If you want to find files that are non-readable by you, you could use
find . ! -readable
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With