Skip to content

Demo preview. Courses, instructors, reviews and prices are sample content. Payments are simulated.

XOps, home

Linux File Permissions in Ten Minutes

Read, write and execute for user, group and others. Once you can read a permission string, most “permission denied” errors explain themselves.

Daniel Kurian · 4 min readSample article
Abstract illustration of a terminal window

Run ls -l and each line starts with a string such as -rw-r--r--. After the first character, which shows the file type, come three groups of three letters: permissions for the owner, the group, and everyone else.

shell
$ ls -l deploy.sh
-rwxr-x--- 1 deploy ops 812 Oct 15 09:12 deploy.sh

Here the owner can read, write and execute the script, members of the ops group can read and execute it, and nobody else can do anything with it.

Changing permissions

shell
$ chmod g-x deploy.sh      # remove execute for the group
$ chmod 640 config.env     # owner read/write, group read, others nothing
  • Linux