Permission (Access Mode) by Owner Status
The ls -l
command gives you the access mode information of a directory or file. Here are the key points of how to read the information.
Three User Types
Based on the three owner statuses, the access mode is different for each one. By running the ls -l command, you'll see 9 characters defining the access mode.
- The first three letters: owner's access mode
- Next three letters: owner group's access mode
- The last three letters: others' access mode
Read (r), Write (w) and Execute (x) permissions
There are three types of permissions (access modes). Read (r
), Write (w
) and Execute (x
). The meaning of permissions is slightly different for files and directories.
For files,
- Read (
r
) : Be able to read the file - Write (
w
) : Be able to edit the file - Execute (
x
) : Be able to run the command defined in the file
For directories,
- Read (
r
) : Be able to list file and directory names under the directory (read the contents of the directory) - Write (
w
) : Be able to create and remove files, and change the name of files in the directory - Execute (
x
) : Be able to set the directory as the current working directory (CWD)