Modifying file and directory permissions
Now that you have a thorough understanding of how to understand the permission system in Linux, we can work on actually changing the permissions of objects. To do so, we have two commands: chmod and chown. The chmod
command is the one we'll use to modify the permission string of an object. The chown
command is what we'll use to change the owner or group of an object.
In order to understand these concepts better, create some spare files and directories anywhere on your system so that you aren't modifying any critical component. You can set up a little lab in your home directory, for example, and create several files to modify their permissions. To start with, we'll walk through the basic usage of the chmod
command.
For instance, let's assume that we have the following output of the ls -l
command in our current working directory:
drwxr-xr-x 4 Sally users 4096 Dec 31 13:54 Budget drwx------ 11 Tom users 4096 Dec 24 14:11 Music
In the preceding...