Linux File Permissions Cheatsheet — chmod, chown, umask

Understanding Linux permissions: chmod octal/symbolic notation, chown, chgrp, special permissions, umask.

Permission Basics

-rwxr-xr-x  1  user  group  4096  Feb 22  file.txt
│├─┤├─┤├─┤
│ │   │  └── Others: read + execute
│ │   └───── Group: read + execute
│ └───────── Owner: read + write + execute
└─────────── Type: - file, d directory, l symlink

Octal Notation

NumberPermissionMeaning
7rwxRead + Write + Execute
6rw-Read + Write
5r-xRead + Execute
4r--Read only
0---No permission

Common chmod Values

CommandMeaningUse Case
chmod 755 fileOwner: full, Others: read+execScripts, executables
chmod 644 fileOwner: read+write, Others: readRegular files
chmod 600 fileOwner only: read+writeSSH keys, secrets
chmod 700 dirOwner only: full accessPrivate directories
chmod 777 fileEveryone: full accessAlmost never use this!

Symbolic Notation

chmod u+x file    # Add execute for owner
chmod g-w file    # Remove write from group
chmod o=r file    # Set others to read only
chmod a+r file    # Add read for all
chmod u=rwx,go=rx file  # Same as 755

Ownership

chown user file           # Change owner
chown user:group file     # Change owner and group
chown -R user:group dir/  # Recursive

Need These Tools as an API?

TextForge API offers 20+ developer toolkit endpoints. Free tier: 50 requests/day.

Try TextForge API Free →

Related Tools