That's a good reference, a bit informative, but it doesn't show examples where someone would perform an
command and see the results, thus also seeing the details. It should also probably explain owners, groups, as well as permissions.
Wiew the results of a long directory listing
desktop:/bin$ ls -l | more
-rwxr-xr-x 1 root root 818232 2010-04-18 21:51 bash
-rwxr-xr-x 3 root root 30200 2010-09-10 17:36 bunzip2
-rwxr-xr-x 1 root root 1269432 2010-04-22 16:04 busybox
-rwxr-xr-x 3 root root 30200 2010-09-10 17:36 bzcat
lrwxrwxrwx 1 root root 6 2011-02-21 10:47 bzcmp -> bzdiff
-rwxr-xr-x 1 root root 2140 2010-09-10 17:36 bzdiff
This is not all the files, just a quick example, but the point here is to examine two parts of this as examples:
bash is a file, because there is no 'd' at the start of it all.
bash has permissions for read, write, execute for the owner
bash has permissions for read, and execute for group, and world. Note that typically to execute, people should have read and execute together, or that's most common.
bash is owned by root, and in the root group.
bzcmd is a logical, or symbolic link which actually points to bzdiff, which is the next file in the listing, to me this is uncommon, many times a symbolic link will point to a file in a different directory entirely; however this is not illegal, just funny/odd that it happened to be a same directory file, next in alphabetical line.
bzcmd is owned by root, in the root group, and has read, write, and execute permissions for all: owner, group, and world.
If someone issues:
they'll find out what groups <username> is in. Sudo may have to be used to perform this on other users.
chmod, chown, and chgrp are useful tools to manipulate permissions (chmod), ownership (chown), and group (chgrp).
But without even trying to alter these things, the knowledge of what the long directory listing is telling you is helpful to understand. And clearly when you create files, you'll see that your username becomes the owner.
Creating your own files is also controlled by the umask, which is a local environment setting. Basically umask is the inverse of permissions. If your umask is 022 then a newly created file by you will have the mode of 755. Because if you look at each digit. umask of 022 is 000 010 010 in binary. If you swap all the zeros and ones you end up with 111 101 101 which in decimal is 755. I'm leaving out special modes which one sees in the umask. Instead of 022, it's really 0022 how you express it in your profile. The first digit is used to control special modes, one of which is the sticky bit. I've never used it, it's an old convention and I'm not sure it's really widely used these days.