Skip to Content
Navigation:

A stick figure smiling

Here's a preview from my zine, Bite Size Linux!! If you want to see more comics like this, sign up for my saturday comics newsletter or browse more comics!

Image of a comic. To read the full HTML alt text, click "read the transcript". get the zine!
read the transcript!

There are 3 things you can do to a file

read write execute

ls -l file.txt shows you permissions.

Here’s how to intepret the output:

rw- rw- r-- bork staff

the first rw- means bork (user) can read & write
the second rw- means staff (group) can read & write
r-- means ANYONE can read

File permissions are 12 bits

The first digit is setuid, the second digit is setgid, the third digit is sticky
110 (user) 110 (group) 100 (all)

For files:
r = can read
w = can write
x = can execute

For directories, it’s approximately:
r = can list files
w = can create files
x = can cd into & access files

110 in binary is 6

So rw-
= 110
= 6

r--
= 100
= 4

r--
= 100
= 4

chmod 644 file.txt means change the permissions to rw- r-- r--: simple!

setuid affects executables

$ls -l /bin/ping rws r-x r-x root root

(the s means ping always runs as oot)

setgid does 3 different unrelated things for executables, directories, and regular files.

person: unix why!
unix, cheerfully: it’s a long story