Unix or Unux-like system like mac or linux allow multiple users in a single machine.
As regular users, we don’t have permission to write or even read every file on the machine.
For example, if i try to read the file /etc/sudoers using cat
. I get a “permission denied” message.
Groups
On unix systems, a single user may be the owner of files and directories, meaning that they have control over their access. Additionally, users can belong to groups which are given access to particular files and folders by their owners.
File Type
The very first charater indicates the type of the file. Some of the more common types and their corresponding attributes are:
- -: regular file
- d: directory
- c: character special file
- I: symbolic link
Understand Permissons
permission: owner, group, world(anyone else)
Permissions
Character | Effect On Files | Effect On Directions |
---|---|---|
r | file can read | directory’s content can be listed |
w | file can be modified | directory’s contents can be modified (create new files, rename files/folders) but only if the executable attribute is also set |
x | file can be treated as a program be executed | allows a directory to be entered or “cd”ed into |
- | file cannot be read, modified or executed depending on the location of the - character |
directory contents cannot |