← All commands
Topic hub Security & Permissions
Windows Linux Security & Permissions File System

Windows cacls / icacls equivalent in Linux

Views and sets fine-grained file permissions beyond the basic owner/group/other model.

Windows cacls / icacls
Linux equivalents
Debian/Ubuntu same command
getfacl / setfacl
Fedora same command
getfacl / setfacl
Arch same command
getfacl / setfacl

Overview

What this command does

Views and sets fine-grained file permissions beyond the basic owner/group/other model.

Migration tip: Basic Linux permissions (chmod) cover most needs. For Windows-style fine-grained ACLs, install the acl package and use setfacl.

Practical tasks

Common use cases

Advanced file access control lists (ACL)

Views and sets fine-grained file permissions beyond the basic owner/group/other model.

getfacl file

Show current ACL for file

setfacl -m u:john:rw file

Give john read+write access

setfacl -m g:devs:rx dir

Give devs group read+execute

Ready to run

Copyable Linux commands

Review paths, device names, package names and permissions before running any command.

sudo apt install acl
getfacl /var/www/html
setfacl -m u:john:rw /var/www/html

Walkthrough

Examples with explanations

# Windows: icacls file.txt /grant John:F

# Install ACL tools:
sudo apt install acl

# View ACLs:
getfacl /var/www/html

# Grant a specific user access:
setfacl -m u:john:rw /var/www/html

Reference

Common options and variations

Command or optionUse
getfacl fileShow current ACL for file
setfacl -m u:john:rw fileGive john read+write access
setfacl -m g:devs:rx dirGive devs group read+execute
setfacl -b fileRemove all ACL entries
setfacl -R -m u:john:rx dir/Apply ACL recursively

Distro differences

Debian/Ubuntu vs Fedora vs Arch

This command is the same on Debian/Ubuntu, Fedora and Arch Linux when the relevant tool is installed.

DistributionPackage manager / baseEquivalent commandDifference to notice
Debian/Ubuntu same command getfacl / setfacl Same command on this distribution.
Fedora same command getfacl / setfacl Same command on this distribution.
Arch same command getfacl / setfacl Same command on this distribution.

Keep learning

Related Security & Permissions commands