The file names are on the far right side of each line, and the file details precede the names. The necessary details to check file permissions are 1 the series of letters and dashes on the far left of each line, and 2 the two columns that have root in them in the preceding example. The rest of this article explains how to interpret and use these details. In the preceding examples, the first character in each list was either a dash - or the letter d. The letter d indicates that the file is a directory, which is basically a special kind of file.
A special file type that you might see is a symlink, sometimes called a soft link. It begins with a lowercase L , as shown in the following example:. The first trio of letters after the file type in a file list rwx shows the permissions for the user , or file owner. The next trio of characters also rwx shows the permissions for the group category. The last trio of characters r-x shows the permissions for the final category, other. In this example, users who are neither the file owner nor in the group have read and execute permissions but not write, as indicated by the dash - in the middle position.
Notice the specific order to the permissions in a trio: read, write, execute. The number listed after the permissions indicates the link count of a file or the number of contained directory entries, for a directory.
This number is not relevant for permissions. After the number of links, two names are listed. Note : There is no space between the categories; we only use commas to separate them. This option is faster, as it requires less typing, although it is not as straightforward as the previous method.
As you have to define permission for each category user, group, owner , the command will include three 3 numbers each representing the summation of privileges. Note: If you need a more in-depth guide on how to use Chmod In Linux to change file permissions recursively, read our Chmod Recursive guide.
Aside from changing file permissions, you may come across a situation that requires changing the user file ownership or even group ownership. Performing either of these tasks requires you first need to switch to superuser privileges. Use one of the options outlined in the previous passage. To change the file ownership use the chown command :. Learning how to check and change permissions of Linux files and directories are basic commands all users should master.
To change file's group permissions, you might find helpful our article on how to use the chgrp command. No matter whether you prefer using the GUI or command-line, this article should help you better understand how to use file permissions.
Introduction Linux, like other Unix-like operating systems, allows multiple users to work on the same server simultaneously without disrupting each other. Was this article helpful? Sofija Simic. Alongside her educational background in teaching and writing, she has had a lifelong passion for information technology. She is committed to unscrambling confusing IT concepts and streamlining intricate software installations. Next you should read. The first character of each line in the output shows if the listed object is a specific directory.
A d indicates that the list is a directory. In the first line, there is no d, which shows that it is a regular file. X, g, and r appear multiple times. They are grouped into three groups based on their ownership level:. Owner Permissions : The first three characters following the directory d slot indicate permission settings for a particular owner.
Group Permissions : The rwx set represents the permissions of the group. A group member can only read a file when using the command -rw-r—r—. Members of a group can view and enter the directory when the permissions are drwxr-xr-x.
0コメント