Linux file permissions
Updated 2026-02-15
chmod, chown, umask, and numeric modes. Read, write, execute for owner, group, and others.
Numeric modes
r=4, w=2, x=1. 7=rwx, 6=rw-, 5=r-x, 4=r--, 0=---. Owner (7) + Group (5) + Others (5) = 755. 644 = rw-r--r--.
chmod and chown
chmod 755 script.shOwner rwx, others rx.
chmod +x fileAdd execute for all.
chmod -R 755 dirRecursive.
chown user:group fileChange owner and group.
chown -R user:group dirRecursive chown.
umask
umask 022: new files 644, dirs 755. umask 002: files 664, dirs 775. Default = 666 - umask (files), 777 - umask (dirs).