shellstreak

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.

WhoRead rWrite wRun xDigit
Owner7
Group5
Others5

Number 755

ls -l shows -rwxr-xr-x

Commandchmod 755 notes.txt
Or letterschmod 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.

learner@shellstreak: ~
Starting your practice shell…

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.

Keep the terminal cheat sheet handy: free to print

Get the shellstreak newsletter

Short terminal and Git tips you can try in a minute, plus a heads-up when new free tools and lessons ship. It lands now and then, never a flood.

No spam, unsubscribe in one click.