Summery
icacls is Windows’ command-line tool for viewing and modifying file/folder ACLs (Access Control Lists). It lets you grant, deny, or audit permissions for users/groups on files and directories - kinda like Linux’s chmod but for NTFS.
Commands
icacls file.txt - Check the user’s rights over a file
icacls folder - Check the user’s rights over a folder
icacls file.txt /inheritance:e - Restores inheritance permissions from parent folder to that file
Dictonary
Because icacls output is strange, here’s a table of what each letter meants:
| Mask | Permissions |
|---|---|
| F | Full access |
| M | Modify access |
| RX | Read and execute access |
| R | Read-only access |
| W | Write-only access |
I just means that the a given permissions was inherited from the directory |
There are also few generic permissions that you might see:
| Mask | Meaning |
|---|---|
| GA | Generic All ~ F |
| GR | Generic Read ~ R |
| GW | Generic Write ~ W |
| GX | Generic Execute ~ X |
There is also a bunch of others, but they are used way less:
| Mask | Meaning |
|---|---|
| D | Delete |
| WDAC | Write DAC (change permissions) |
| WO | Write owner (take ownership) |
| RC | Read control (read security descriptor) |
| X | Execute / traverse folder |
| RD | Read data / list directory |
| WD | Write data / create files |
| AD | Append data / create folders |
| RA | Read attributes |
| WA | Write attributes |
| REA | Read extended attributes |
| WEA | Write extended attributes |
| S | Synchronize |
| OI | Permissions are inherited by files inside the folder |
| CI | Permissions are inherited by subfolders |
References
Similar commands: Get-ACL