bash:find:find_files_based_on_their_permissions
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
bash:find:find_files_based_on_their_permissions [2022/06/13 08:47] – [Using "-" prefix] peter | bash:find:find_files_based_on_their_permissions [2022/06/13 08:59] (current) – peter | ||
---|---|---|---|
Line 43: | Line 43: | ||
<WRAP info> | <WRAP info> | ||
- | **NOTE: | + | **NOTE: |
- | We have set 766 permission to file2, but this command displays two files, why? | + | * Yes, it will display files which do have 766 permissions. |
- | * Because, here we have used a **“-”** prefix”. | + | * But this may also display some files which do not have exact 766 permissions. |
- | * It means that this command will find all files where the file owner has read/ | + | * This could include |
- | + | ||
- | * In our case, file1 and file2 have met this criteria. | + | |
- | * In other words, the files need not to have exact 766 permission. | + | |
- | * It will display any files that falls under this 766 permission. | + | |
</ | </ | ||
Line 90: | Line 86: | ||
===== Find Files Based On their Permissions using symbolic notation ===== | ===== Find Files Based On their Permissions using symbolic notation ===== | ||
- | In the following examples, we use symbolic | + | Symbolic |
- | | + | <WRAP info> |
+ | **NOTE:** | ||
+ | |||
+ | * The letter **a** can be used to represent all three of these categories. | ||
* The permissions can be specified using letters r (read), w (write), x (executable). | * The permissions can be specified using letters r (read), w (write), x (executable). | ||
- | For instance, to find any file with group write permission, run: | + | </ |
+ | |||
+ | ---- | ||
+ | |||
+ | ==== To find any file with group write permissions ==== | ||
<code bash> | <code bash> | ||
Line 101: | Line 104: | ||
</ | </ | ||
- | As you see in the above example, file1 and file2 have group write permission. | + | <WRAP info> |
+ | **NOTE: | ||
- | Please note that you can use either | + | |
+ | |||
+ | </ | ||
For example, the following two commands will do the same thing. | For example, the following two commands will do the same thing. | ||
Line 112: | Line 118: | ||
</ | </ | ||
- | To find any file which are writable by the file owner, run: | + | ---- |
+ | |||
+ | ==== Find any file which are writable by the file owner ==== | ||
<code bash> | <code bash> | ||
Line 118: | Line 126: | ||
</ | </ | ||
- | To find any file which are writable by all (the file owner, group and everyone else): | + | ---- |
+ | |||
+ | ==== Find any file which are writable by all (the file owner, group and everyone else) ==== | ||
<code bash> | <code bash> | ||
Line 124: | Line 134: | ||
</ | </ | ||
- | To find files which are writable by both their owner and their group: | + | ---- |
+ | |||
+ | ==== Find files which are writable by both their owner and their group ==== | ||
<code bash> | <code bash> | ||
Line 135: | Line 147: | ||
- | To find files which are writable by either their owner or their group, run: | + | ---- |
+ | |||
+ | ==== Find files which are writable by either their owner or their group ==== | ||
<code bash> | <code bash> | ||
Line 147: | Line 161: | ||
</ | </ | ||
- | < | + | <WRAP info> |
**NOTE: | **NOTE: | ||
</ | </ | ||
---- | ---- | ||
+ | |||
+ | ===== Help ===== | ||
For more details, refer the man pages. | For more details, refer the man pages. | ||
Line 159: | Line 175: | ||
</ | </ | ||
- | Also, check the man pages alternatives to learn more simplified examples of any Linux command. | + | |
bash/find/find_files_based_on_their_permissions.1655110043.txt.gz · Last modified: 2022/06/13 08:47 by peter