views
Open the Terminal. You will be using the terminal to change file permissions.
Locate your file. In order to change the permissions of a file, you must be in the directory where the file is located. You can change directories by using the command cd, followed by a space and the name of the directory you want to switch to.
View the current permissions of the file. You should check the current permissions of the files before changing them. The permissions may not need to be changed. Use the command ls -l . Your output will provide details on each file in the directory. In the image above, the red square is the current file permissions and the blue square is the name of the file.Screen Shot 2022 04 03 at 9.28.57 PM.png
Understand the permissions of the file. The file permission string is broken up into blocks. The entities that are files will always begin their permission string with "-". This is shown in the green square. The rest of the permission string (after the "-") represents: Permissions for the owner (e.g., the first three characters ("rw-") in the red square) Permissions for the group owner (e.g., the second three characters ("r--") in the yellow square) Permissions for others (e.g., the last three characters ("r--") in the blue square)
Find the octal number that matches the permissions you want. Use the chart to find the octal number of the permissions you want the file to have. This octal number will be used in changing file permissions.
Use the "chmod" command to change the file's permissions. Use chmod followed by the octal number and the file name. In this case, we are changing the permissions of the file "f5". This command will change your file's permissions to the permissions that correspond with the octal number.
Verify that the file's permissions have been changed. After using the "chmod" command, it is important to make sure the file now has the permissions you want. To view the current file permissions, use the command ls -l. If the permissions of the file have changed to what you want, you have successfully changed your file's permissions.
Comments
0 comment