AI Hints
Home›Linux Tutorial›Users and Permissions
Linux · Lesson 63 of 120

Permissions Explained

Read, write and execute.

⏱ 2 min read▶ Video at 1:21:49🎓 Free
Watch this lesson in the Linux courseWatch on YouTube ↗Full Linux course

Every file and folder on Linux has permissions. They decide who can read it, who can change it, and who can run it. They're what stop one user from reading another user's private files.

Permissions Explained
From the video: Permissions Explained
  • Every file has permissions
  • Read, change, run?
  • They keep users apart

Three permissions

There are just three permissions. R is read, which means you can look at the contents. W is write, which means you can change it. And X is execute, which means you can run it, as a program. For a folder, execute means you can go inside it.

r readlook at the contents
w writechange it
x executerun it as a program
Foldersx means you can enter

Three kinds of people

And these permissions are given to three kinds of people. The owner of the file, called the user. The file's group. And everyone else, called others. So for each file, Linux answers three questions, three times.

u userthe owner
g groupthe file's group
o otherseveryone else
3 × 3nine permissions in all

Permissions in practice

Sam's home folder is private. Alex's home folder shows RWX, then dashes, so Alex can do everything, and nobody else can do anything. When Sam tries to look inside, Linux says, permission denied.

Terminal
ls -ld /home/alex
drwx------ 2 alex alex 4096 Dec 20 10:00 /home/alex
ls /home/alex
ls: cannot open directory '/home/alex': Permission denied

Summary

Three permissions, read, write, and execute, for three kinds of people, the user, the group, and others. Next, reading the permission letters in LS dash L.

Key takeaways
  • r w x
  • user, group, others
  • Permission denied
Next up: Reading Permission Strings — rwxr-xr-x decoded