chmod calculator
Tick who may read, change and run a file, or paste a mode like 755, rwxr-xr-x or a whole line from ls -l. You get the command both ways and what it means in plain words.
Numbers (644), letters (rw-r--r--), an ls -l line, or u=rw,go=r.
| Who | Read r | Write w | Run x | Digit |
|---|---|---|---|---|
| Owner | 7 | |||
| Group | 5 | |||
| Others | 5 |
Number 755
ls -l shows -rwxr-xr-x
chmod 755 notes.txtchmod u=rwx,go=rx notes.txt- ownerThe owner (usually you) can read it, change it and run it as a program.
- groupMembers of the file's group can read it and run it as a program.
- othersEveryone else on the machine can read it and run it as a program.
Run chmod 755 notes.txt on a practice file and see what ls -l says.
Common modes
Questions
What does chmod 755 mean?+
The owner can read, write and run the file; the group and everyone else can read and run it but not change it. It's the usual mode for scripts, programs and folders.
What does chmod 644 mean?+
The owner can read and change the file; the group and everyone else can only read it. It's the usual mode for documents, web pages and config files.
How do the numbers work?+
Each digit is one class of people: owner, group, others. Add 4 for read, 2 for write and 1 for execute. So 7 = 4+2+1 (rwx), 5 = 4+1 (r-x), 6 = 4+2 (rw-) and 0 = nothing.
Is chmod 777 safe?+
Almost never. It lets every user on the machine change or replace the file. When something says Permission denied, give only the access that's missing (often chmod u+x for a script, or 644 / 755).
What does x mean on a folder?+
On a folder, x means you can open it: cd into it and reach the files inside. r lets you list the names, and w lets you add, rename and delete files in it.
Practise this in 5 minutes
Lesson 34, chmod with numbers, walks you through reading ls -l and setting permissions with numbers and letters in a safe terminal, step by step, and checks your answers.