Chmod Calculator: Unix File Permissions
Tick read, write and execute for owner, group and others to get the chmod number, the ls -l letters and the command.
Work out Unix and Linux file permissions. Tick read, write and execute for the owner, the group and everyone else, and see the number chmod uses (such as 755), the letters ls -l shows (rwxr-xr-x) and a plain sentence saying who can do what. Or type a mode, either digits like 644 or 0750 or letters copied from ls -l, to decode it. Setuid, setgid and the sticky bit are covered too, shown as s, S, t and T the way ls prints them. Ready-made commands are written for the file name you type: chmod with the number, chmod with letters (u=rwx,g=rx,o=rx), chmod -R for a folder and everything in it, and a find command that changes only folders. A list of common modes explains when to use each, and a umask box shows what permissions new files and folders get. The Linux Command Cheatsheet covers the commands around it.
A number like 755 or 0644, or letters like rwxr-xr-x (from ls -l).
| Who | Read (4) | Write (2) | Execute (1) | Digit |
|---|---|---|---|---|
| Owner | 7 | |||
| Group | 5 | |||
| Others | 5 |
- Owner can read, write, execute.
- Group can read, execute.
- Others (everyone else) can read, execute.
Commands
chmod 755 file.txtchmod u=rwx,g=rx,o=rx file.txtchmod -R 755 file.txtfind file.txt -type d -exec chmod 755 {} +Common modes
The mask new files and folders start from. 022 is the usual default.
New files get 644 (rw-r--r--) and new folders get 755 (rwxr-xr-x).
Common use cases
- Fix a permission denied error on a server or script
- Set safe permissions for SSH keys and .env files
- Decode the letters ls -l shows
- Prepare for a Linux course or exam
How to use
- Tick the boxes, or type a mode such as 755 or rwxr-xr-x.
- Read the explanation of who can do what.
- Type your file or folder name.
- Copy the command you need.
FAQ
How do chmod numbers work?
Each digit is one set of people, owner, group and others, made by adding read (4), write (2) and execute (1). 7 is all three, 5 is read and execute, 4 is read only, so 755 means the owner can do everything and everyone else can read and run.
What does 644 mean?
The owner can read and change the file; everyone else can only read it. It's the usual setting for ordinary files and web pages.
Why shouldn't I use 777?
It lets every user on the machine change or replace the file. On a web server that's a common way in for attackers; 755 or 775 usually does the job.
What does execute mean on a folder?
On a folder, execute (x) means being allowed to open it and reach the files inside. Folders usually need it, which is why they're 755 while files are 644.
What are setuid, setgid and sticky?
Setuid makes a program run as its owner, setgid runs it as its group (or, on a folder, gives new files the folder's group), and sticky stops people deleting each other's files in a shared folder like /tmp.
Related tools
- SSH Key GeneratorGenerate SSH key pairs for secure authentication.
- Cron Expression BuilderBuild cron expressions with interactive UI.
- Regex TesterTest and debug regular expressions with real-time match highlighting.
- Unzip Files Online: Open a ZIP in Your BrowserUnzip files online without uploading them: open a .zip, see every file and folder, preview pictures and text…
- Zip Files Online: Make a ZIP File FreeZip files online for free: add files or a whole folder, keep the folder structure, choose how hard to…
- CSS Box Shadow Generator With Live PreviewFree CSS box shadow generator: set the offset, blur, spread, opacity and shade, stack layers or start from a…
- Linux Command CheatsheetIn Reference