ls -lstep 1 of 7
Read the permissions
Every file has rules about who may read it, change it and run it. ls -l (a lowercase L, for “long”) shows them:
$ ls -l scripts total 8 -rw-r--r-- 1 you you 141 Oct 21 09:14 backup.sh -rw-r--r-- 1 you you 40 Oct 21 09:14 hello.sh
The first column is the one that matters. Skip the first character (- for a file, d for a folder) and read the rest in three groups of three:
rw-is what you, the owner, can do: read and writer--is what your group can do: read onlyr--is what everyone else can do: read only
r is read, w is write, x is execute (run it as a program), and - means no. Then come the owner’s name, the group, the size in bytes, and when it last changed.
Your turn, in the terminal
- Show the permissions of the files in scripts