40 lines
1.1 KiB
Markdown
40 lines
1.1 KiB
Markdown
|
---
|
||
|
tags: [Linux, permissions]
|
||
|
created: Friday, April 11, 2025
|
||
|
---
|
||
|
|
||
|
# File permissions in Linux
|
||
|
|
||
|
## View permissions
|
||
|
|
||
|
```bash
|
||
|
ls -rfl
|
||
|
```
|
||
|
|
||
|
## What the letters mean
|
||
|
|
||
|
```bash
|
||
|
drwxr-xr-x 2 thomas thomas 4096 Jan 21 18:00 dist
|
||
|
drwxr-xr-x 2 thomas thomas 4096 Dec 29 12:50 out
|
||
|
-rw-r--r-- 1 thomas thomas 1108 Jan 21 17:42 README.md
|
||
|
```
|
||
|
|
||
|
The first column of the permissions output is known as the file's _mode_. The
|
||
|
sequence from left to right is as follows:
|
||
|
|
||
|
```
|
||
|
- - - - - - - - - -
|
||
|
type user permissions group permissions other permissions
|
||
|
```
|
||
|
|
||
|
<dl>
|
||
|
<dt>type</dt>
|
||
|
<dd>The file type. A dash just means an ordinary file. `d` means directory </dd>
|
||
|
|
||
|
<dt>user permissions</dt>
|
||
|
<dd>read, write or execute. A dash means 'nothing': the permissions for that slot in the set have not be assigned</dd>
|
||
|
|
||
|
<dt>group and other</dt>
|
||
|
<dd>group is obviously what anyone belonging to the current file's user group can do. Everyone else (outside of the user and the group) is covered by the other permissions, sometimes known as 'world' permissions</dd>
|
||
|
</dl>
|