TOPIC LINUX
File Permissions rwx and who you are
IN 10 SECONDS
Linux assigns read (r), write (w), and execute (x) permissions to three ownership tiers: User (owner), Group, and Others. Represented numerically: r=4, w=2, x=1.
GOTCHA Execute permission on a directory lets you change directory (cd) into it and read files inside, while read permission only lets you list its filenames.
HOW PERMISSION CHECKING FLOWS
01 Access call a process tries to read, write, or execute a file.
02 User tier if the process owner matches the file owner, User permissions are checked.
03 Group tier if the owner doesn't match but matches the file's group, Group permissions are checked.
04 Other tier if neither matches, Others permissions are applied. If permissions fail, access is denied.
POKE IT YOURSELF
ls -l — list files with ownership and permission strings
chmod 755 script.sh — make file readable/executable by everyone, writeable only by owner
Drill this topic →
~60 sec read