---
id: "unix_file_mode"
kind: "datatype"
status: "draft"
is_pii: false
name: "Unix file mode (-rw-r--r--, 0644)"
regexp: "^[-dlcbps][-r][-w][-xsS][-r][-w][-xsS][-r][-w][-xtT]$"
categories: ["software"]
langs: ["common"]
quality: 90
url: "https://registry.apicrafter.io/datatype/unix_file_mode"
---

# Unix file mode (-rw-r--r--, 0644) (`unix_file_mode`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

File type and permission bits of a file in a Unix file system, in the symbolic form of ls -l: ten characters, the type (- for a file, d for a directory, l for a symbolic link) and the read, write and execute rights of the owner, the group and others (-rw-r--r--, drwxr-xr-x), with s or t for the setuid, setgid and sticky bits. The same bits are written in octal for chmod (0644, 755). The tree views of repository browsers such as cgit and gitweb list it in a Mode column.

- Personal data (PII): no
- Categories: Software development (software)
- Countries: global
- Languages: Common to most languages (common)
- Classification: categorical

## Detection

Regular expression (Python `re`):

```
^[-dlcbps][-r][-w][-xsS][-r][-w][-xsS][-r][-w][-xtT]$
```

## Examples

- `-rw-r--r--` — a file readable by all
- `drwxr-xr-x` — a directory
- `lrwxrwxrwx` — a symbolic link
- `-rwsr-xr-x` — setuid
- `rw-r--r--` (invalid example) — without the type

## Metacrafter rules

2 rules: 1 match the field name, 1 match values.

- `unixfilemodebyname` (field, `common/software.yaml`)
- `unixfilemodevalue` (data, `common/software.yaml`)

## Supported by tools

- [`metacrafter`](https://registry.apicrafter.io/tool/metacrafter.md)

## Translations

- ru: Права доступа к файлу Unix (-rw-r--r--, 0644)

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/File-system_permissions>
- wikipedia: <https://en.wikipedia.org/wiki/Chmod>
- doc: <https://pubs.opengroup.org/onlinepubs/9799919799/utilities/ls.html>

## Quality

Score 90/100. Missing: mapping (Wikidata, Schema.org, ...).

JSON: <https://registry.apicrafter.io/api/v1/datatypes/unix_file_mode.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/software/unix_file_mode.yaml>
