Files, directories, and permission commands
Files and directories are organized in a hierarchical structure, with the root directory as the top-most level. Each file and directory has a set of permissions that determine who can read, write, or execute it. The file permissions are divided into three categories—user, group, and others:
- user: This refers to the owner of the file
- group: This refers to a group of users assigned to the file (e.g., developers)
- others: This refers to anyone else who is not the owner or part of the assigned group
Let’s take a look at the hierarchical structure:
Figure 2.14 – Linux files and directory hierarchical structure
To manage file and directory permissions in Linux, there are several command line tools available. Some of the commonly used commands include chmod, chown, and chgrp.
chmod
The chmod command is used to change the permissions of a file or directory. To recursively...