
Right now we’ll focus on the text on the left, drwxr-xr-x or -rw-r-r- in lines 3 and 4 respectively. You can also see the permissions of a specific file using: ls -l filename.extensionĪfter running the ls -l command, you will see something like this: : ~/Desktop# ls -l Use the ls -l command to list the files, directories, and their permissions: ls -l Let’s see how we can view the permissions of a file or a folder. Now that you know the user and permission types, an example will help you understand the whole picture.

In the following example, we add write permission for the current group of the file. But also the group permissions can be changed by using the chmod command. Generally, user permissions are changed by using the chmod command. $ chmod -R u+x nmap Change Group Permission In order to change the permission of all specified folder child files and folders the recursive parameter -r can be used. This does not affect child files and folders in a recursive way.

When we change a folder or directory permission it only affects the specified folder or directory. $ chmod u-w /home/ismail/main.c Change Folder Permission Recursively
CHMOD READWRITE FULL
$ chmod u-w main.cĪlternatively, we can use the absolute or full path of the file or folder in order to change permissions. In the following example, we remove the write permission for the current user. If we need to remove already existing permission we can use the - sign. In the following example, we add the write permission for the current user. The user is expressed with the u letter and the write permission is depicted with the w. List File and Folder Permissions Change File and Folder Permissionįile permission for the user of the specified file can be changed like below. The -l option is added to the ls command.

The ls command can be used to list user, group, and other permissions with the current user and group information. List File and Folder Permissionsīefore starting to work with file and folder permissions we generally require to list current permissions about files and folders.

We can use digit 6 to express read and write permission. We can also use the digit presentation by summing the read and write values 4+2 = 6. For example, we can specify the read and write permission with the w and r letters. The chmod command can be used with both letter permissions or value permissions. MeaningĬhmod Read, Write, Execute Permission Calculation FILE_FOLDER is the file or folder we want to change its permission.ĭisplay chmod Command Help Permission Calculationīefore starting to use the chmod command we should learn how the permissions are set and calculated.OPTION is chmod command option or permission values about the FILE_FOLDER.The chmod command is used with options and files and folders. The chmod command is created in 1971 with the Unix operating system which makes it one of the oldest commands used today in a popular way. The read, write, execute permissions with the sticky bit feature can be changed by using the chmod command. The chmod command name comes from change mode. Linux and Unix operating systems provide the chmod command in order to change access permission for the files and folders.
