Skip to main content
intermediate Free with email

Linux File Permissions Cheat Sheet: chmod, chown and umask Explained (Free PDF)

Reviewed 2026-09-16

Direct answer
Linux file permissions decide who can read, write or execute a file. Each file has rwx bits for the owner, the group and everyone else. Change them with chmod (755 for scripts and directories, 644 for files), change ownership with chown, and set defaults for new files with umask.

Linux file permissions decide who can read, write or execute a file. Every file has three sets of rwx bits, one for the owner, one for the group and one for everyone else, and you change them with chmod, change who owns the file with chown, and set the defaults for new files with umask.

This page explains the logic behind each one: how to read rwx in ls -l, how symbolic and octal notation map to each other, and the mistake that wrecks a whole directory when you run chmod -R without thinking first. Grab the free PDF for the quick-reference version.

How Linux File Permissions Work: Who, What and How

chmod 755 isn’t hard to copy and paste. Understanding why it’s 755 and not 750 is where people get stuck.

Three separate ideas get bundled into one command: who can act on a file (owner, group, everyone else), what they can do (read, write, execute), and how you write that down (letters or a number). Miss one piece and you either lock yourself out of your own script, or leave a config file world-writable without noticing.

Reading Linux File Permissions with ls -l

Run ls -l on any file and you get a line like this:

-rwxr-xr-x 1 root staff 8192 Sep 16 10:02 deploy.sh

Break down that 10-character block:

PositionMeaning
1st characterFile type: - file, d directory, l symbolic link
Characters 2-4Owner’s permissions (rwx)
Characters 5-7Group’s permissions (rwx)
Characters 8-10Everyone else’s permissions (rwx)

So -rwxr-xr-x reads as: a regular file, the owner can read, write and execute, the group and everyone else can read and execute. No write access outside the owner. That’s a normal, safe set for a script other people need to run but shouldn’t edit.

chmod Command: Symbolic vs Octal Notation

There are two ways to give chmod the same instruction. Pick whichever fits the job.

Symbolic notation changes permissions relative to what’s already there:

chmod u+x script.sh    # add execute for the owner
chmod g-w file.txt     # remove write from the group
chmod o=r config.yml   # set "others" to read-only, nothing more
chmod a+x setup.sh     # add execute for everyone

u (user/owner), g (group), o (other), a (all). + adds, - removes, = sets exactly, wiping whatever was there.

Octal notation sets the whole permission set at once, with three digits (owner, group, other). Each digit is a sum:

ValuePermission
4Read
2Write
1Execute

Read + write + execute = 4+2+1 = 7. Read + execute = 4+1 = 5. Read only = 4.

Octal digitSymbolic
0---
1--x
2-w-
3-wx
4r--
5r-x
6rw-
7rwx

Look up each digit, read left to right, and you’ve decoded any octal permission without a calculator. The full flag list lives in the chmod manual page.

chmod 755 vs 644 vs 777: The Numbers You’ll Actually Use

Three numbers cover most real work.

Linux file permissions compared: chmod 755 gives owner rwx and others r-x, chmod 644 gives owner rw- and others read only
The two Linux file permissions you’ll set most: 755 for scripts and directories, 644 for regular files.
chmod 755 script.sh   # owner rwx, group r-x, other r-x
chmod 644 file.txt    # owner rw-, group r--, other r--
chmod 700 secret.key  # owner rwx, group and other: nothing

755 is for scripts and directories: everyone can run or enter it, only the owner can change it. 644 is for ordinary files and configs: everyone can read, only the owner can edit. 777 gives every user on the system full read, write and execute access. It’s almost never the right answer outside a throwaway test box. If you’re reaching for it to make an error go away, the real problem is usually ownership or the wrong user, and chown is the fix.

chmod Recursive: Changing Permissions on a Whole Directory

chmod -R applies a change to a directory and everything inside it. Sounds simple. It’s the most common way people break a deployment.

chmod -R 755 /var/www/app

This sets 755 on every file and every directory underneath, including files that had no business being executable. A directory needs the execute bit so you can enter it. A text config file doesn’t need execute at all. Blanket -R 755 marks every file in the tree executable, which is sloppy and hides real permission problems the next time something breaks.

The safer pattern separates files from directories:

find /var/www/app -type d -exec chmod 755 {} \;
find /var/www/app -type f -exec chmod 644 {} \;

Directories get 755, files get 644. If some files genuinely need to run, chmod +x them one by one afterwards.

There’s also a one-line version using capital X, which adds execute only to directories and to files that already have execute set for someone:

chmod -R u+rwX,go+rX,go-w /var/www/app

That’s the version worth remembering if you only take one thing from this section.

chown Command and chgrp: Changing Ownership

chmod controls what’s allowed. chown and chgrp control who it applies to.

chown deploy:www-data app.conf   # set owner to "deploy", group to "www-data"
chown deploy app.conf            # change owner only
chown :www-data app.conf         # change group only
chgrp www-data app.conf          # same as the line above, older syntax
chown -R deploy:www-data /srv/app  # apply to a whole directory tree

Ownership and permissions work together. chmod 640 on a file means nothing useful if the wrong user owns it. Check both when something “isn’t working” and the permission bits look correct.

If you automate servers, the Ansible file module sets owner, group and mode in one task. Our Ansible commands cheat sheet covers it.

Special Permissions: setuid, setgid and the Sticky Bit

Past read, write and execute, three special bits show up often enough to know on sight.

BitOctalWhat it does
setuid4000A program runs with the file owner’s privileges, not the user running it. passwd uses this so regular users can update a file only root can normally write.
setgid2000On a directory, new files inherit the directory’s group instead of the creator’s default group. Common on shared team folders.
sticky bit1000On a directory, only the file’s owner (or root) can delete or rename it, even if others have write access. /tmp uses this so one user can’t delete another user’s temp files.

You’ll see these as a fourth leading digit: chmod 4755 sets setuid plus the usual 755. In ls -l they show up as s, S or t in place of the normal execute character.

umask and Default File Permissions in Linux

Ever notice a new file lands at 644 and a new directory at 755 without anyone running chmod? That’s umask.

Linux starts from a base of 666 for files and 777 for directories (new files never get execute by default). The umask removes bits from that base:

umask       # show the current value
umask 022   # set it

With the common default of 022, new files get 644 and new directories get 755. Change it to 002 on a shared project folder and new files come out group-writable, so the team doesn’t have to chmod after every save.

One catch: umask is a bit mask, not real subtraction. The kernel calculates 0666 & ~022, as the umask manual page shows. “666 minus 022” happens to give the right answer, but it breaks with odd digits. A umask of 033 gives files 644, not 633, because there was no execute bit to remove in the first place.

What’s Inside the Linux File Permissions Cheat Sheet PDF

  • A permissions and ownership section covering chmod (with chmod 755), chown user:group, chgrp and umask, one line each
  • The commands around it: 62 Linux commands across 8 groups, from file operations and text processing to processes, networking, disk, archiving and user management
  • Format: 5 pages, printable

The deeper material, the octal table, the chmod -R pattern, special bits and the umask math, is on this page, so read the page and keep the PDF beside your keyboard.

Who It’s For

  • CompTIA Linux+ and A+ candidates working through the Linux permission and ownership commands
  • DevOps engineers who want to stop guessing at chmod numbers mid-deploy
  • Junior sysadmins troubleshooting “permission denied” errors for the first time
  • Anyone who’s run chmod -R 777 out of frustration and knows that’s not a real fix

Intermediate level. You should already be comfortable in a terminal before this one. If you’re still building that foundation, start with our Linux Commands Cheat Sheet PDF, which covers the 58 commands you’ll type before permissions come up.

Frequently asked questions

Is this Linux file permissions cheat sheet PDF really free?
Yes. No credit card, just your email to get the download link.
What's the difference between chmod 755 and chmod 777?
755 gives the owner full access and everyone else read and execute only. 777 gives everyone, owner, group and every other user, full read, write and execute access. 777 is almost never the right answer outside a throwaway test environment. If you're using it to make an error go away, you're hiding an ownership or path problem, not fixing it.
What do 644 and 755 mean in Linux?
They're octal permission sets. 644 is rw-r--r--: the owner can read and write, everyone else can only read. It's the normal setting for files. 755 is rwxr-xr-x: the owner can do everything, everyone else can read and execute. It's the normal setting for scripts and directories.
How do I check a file's current permissions?
Run ls -l filename. The first character is the type (file, directory or link). The next nine split into three groups of three (owner, group, other), each showing r, w and x, or a dash for "not granted."
Does chmod -R change permissions on files and folders the same way?
Yes, and that's the problem. chmod -R 755 sets the same permission on every file and folder in the tree, even files that shouldn't be executable. Use find with separate rules for files and directories, or chmod -R u+rwX,go+rX,go-w, so directories stay enterable without making every file executable.
What's the difference between chown and chmod?
chmod changes what actions are allowed (read, write, execute). chown changes who the file belongs to (owner and group). You often need both for access to work as intended.

Questions about this PDF

No questions yet. Ask the first one.

Ask a question

Your email address won't be published. We review every question before it appears. How we handle your data. Required fields are marked

Reviewed by

CCDE/CCIE

How to cite this resource

SMEnode Labs (2026). Linux File Permissions Cheat Sheet: chmod, chown and umask Explained (Free PDF). SMEnode Labs. https://smenode-labs.com/free-pdf/linux/free-pdf-linux-linux-file-permissions-cheat-sheet-pdf/

APA

SMEnode Labs. (2026). Linux File Permissions Cheat Sheet: chmod, chown and umask Explained (Free PDF). SMEnode Labs. https://smenode-labs.com/free-pdf/linux/free-pdf-linux-linux-file-permissions-cheat-sheet-pdf/

BibTeX

@misc{smenodelabs2026,
  title = {Linux File Permissions Cheat Sheet: chmod, chown and umask Explained (Free PDF)},
  author = {{SMEnode Labs}},
  year = {2026},
  url = {https://smenode-labs.com/free-pdf/linux/free-pdf-linux-linux-file-permissions-cheat-sheet-pdf/},
  note = {SMEnode Labs}
}