LINUX / A CONCEPT NOTE

File Permissions

rwx and who you are

~60 sec read

Overview · mechanism
pitfall · examples

01 / THE SHORT VERSION

The idea in a few sentences.

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.

02 / FOLLOW THE MECHANISM

How permission checking flows

  1. Access call

    a process tries to read, write, or execute a file.

  2. User tier

    if the process owner matches the file owner, User permissions are checked.

  3. Group tier

    if the owner doesn't match but matches the file's group, Group permissions are checked.

  4. Other tier

    if neither matches, Others permissions are applied. If permissions fail, access is denied.

04 / COMMAND NOTES

Read the command, then the result.

Inspect the flags and arguments before trying an example. Snippets can need local setup, replacement values, or resources in your own environment.

EXAMPLE 01 · REFERENCE

list files with ownership and permission strings

ls -l

EXAMPLE 02 · REFERENCE

make file readable/executable by everyone, writeable only by owner

chmod 755 script.sh

Explore command anatomy in the CLI lab