Unix File Permissions
A complete reference for the 8 possible values of a single Unix permission digit (0–7). Each record maps an octal digit to its three-character symbolic representation (e.g. rwx, r-x) and to individual boolean flags for the read (r), write (w), and execute (x) bits. These digits are combined in triples to form the familiar three-group permission mode used by chmod, ls -l, and POSIX-compliant filesystems.
Quick fetch
Stable URL. CORS-enabled. No auth.
curl https://staticdata.dev/v1/unix-file-permissions.json
Or use as a typed import:
import { unixFilePermissions } from "https://staticdata.dev/v1/unix-file-permissions.ts"
Formats
- JSON 855 B
/v1/unix-file-permissions.json
min: 565 B · /v1/unix-file-permissions.min.json
- CSV 223 B
/v1/unix-file-permissions.csv
- TypeScript 1.1 KB
/v1/unix-file-permissions.ts
export const unixFilePermissions
type FilePermission = (typeof unixFilePermissions)[number]
Schema
Each record in the dataset has the following shape.
| Field | Type | Description | Example |
|---|---|---|---|
| octal | number | Octal digit value (0–7) representing one permission group | 7 |
| symbolic | string | Three-character rwx symbolic notation for this digit | rwx |
| read | boolean | Whether the read bit is set | true |
| write | boolean | Whether the write bit is set | true |
| execute | boolean | Whether the execute bit is set | true |
Preview
First 8 records.
Fetch examples
Drop-in snippets in five languages.
curl -sSL https://staticdata.dev/v1/unix-file-permissions.json | jq '.[0]' import type { FilePermission } from "https://staticdata.dev/v1/unix-file-permissions.ts";
const res = await fetch("https://staticdata.dev/v1/unix-file-permissions.min.json");
if (!res.ok) throw new Error(`Fetch failed: ${res.status}`);
const unixFilePermissions: FilePermission[] = await res.json();
console.log(unixFilePermissions[0]); import urllib.request, json
with urllib.request.urlopen("https://staticdata.dev/v1/unix-file-permissions.min.json") as r:
unixFilePermissions = json.load(r)
print(unixFilePermissions[0]) package main
import (
"encoding/json"
"fmt"
"net/http"
)
func main() {
resp, err := http.Get("https://staticdata.dev/v1/unix-file-permissions.min.json")
if err != nil { panic(err) }
defer resp.Body.Close()
var data []map[string]any
if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
panic(err)
}
fmt.Println(data[0])
} use serde_json::Value;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let body = ureq::get("https://staticdata.dev/v1/unix-file-permissions.min.json").call()?.into_string()?;
let data: Vec<Value> = serde_json::from_str(&body)?;
println!("{:?}", data.first());
Ok(())
} Sources and methodology
Unix file permissions are stored as a bitmask where each of the three permission groups (owner, group, others) is represented by a single octal digit. Each digit encodes three bits: read (value 4), write (value 2), and execute (value 1). The sum of the set bits produces the octal digit, giving 8 possible values from 0 (no permissions) to 7 (full permissions).
This dataset enumerates all 8 digit values with their standard symbolic notation as shown by ls -l. The symbolic field uses r, w, and x for set bits and - for unset bits, matching the POSIX-specified display format. The boolean fields allow direct programmatic testing of individual permission bits without bit-masking.
In practice a full file mode is expressed as three of these digits concatenated (e.g. chmod 755 sets owner=7, group=5, others=5). Special bits such as setuid, setgid, and the sticky bit use a fourth leading digit and are outside the scope of this dataset, which focuses on the core permission digit used for each of the three principal groups.
Versioning
URLs under /v1/ are stable: field names and types will not change in a way
that breaks consumers. Values can be corrected or records added when the upstream source
changes; schema-incompatible updates ship under a new version path. See the
unix-file-permissions changelog for this dataset's history.
Related datasets
More Code datasets
- ansi-colors
- cron-presets
- css-at-rules
- css-functions
- css-named-colors
- css-properties
- css-pseudo-classes
- css-pseudo-elements
- css-units
- data-units
- exit-codes
- file-signatures
- hash-algorithms
- js-array-methods
- js-math-methods
- js-object-methods
- js-string-methods
- json-schema-keywords
- jwt-claims
- mathematical-constants
- measurement-units
- node-builtin-modules
- owasp-top-10
- periodic-table
- physical-constants
- posix-signals
- programming-languages
- regex-flags
- regex-patterns
- roman-numerals
- si-base-units
- si-derived-units
- si-prefixes
- spdx-licenses
- strftime-tokens
- tailwind-colors
- time-units
- unicode-blocks
- unicode-general-categories
- unicode-planes
- xterm-256-colors