staticdata.dev
Menu
Datasets About Contact

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.

bash
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

    Open

    min: 565 B · /v1/unix-file-permissions.min.json

  • CSV 223 B

    /v1/unix-file-permissions.csv

    Open
  • TypeScript 1.1 KB

    /v1/unix-file-permissions.ts

    export const unixFilePermissions

    type FilePermission = (typeof unixFilePermissions)[number]

    Open

Schema

Each record in the dataset has the following shape.

Schema
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.

Data preview
octalsymbolicreadwriteexecute
0---falsefalsefalse
1--xfalsefalsetrue
2-w-falsetruefalse
3-wxfalsetruetrue
4r--truefalsefalse
5r-xtruefalsetrue
6rw-truetruefalse
7rwxtruetruetrue

Showing 8 of 8. View full data:  JSON · CSV

Fetch examples

Drop-in snippets in five languages.

curl
curl -sSL https://staticdata.dev/v1/unix-file-permissions.json | jq '.[0]'
JavaScript
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]);
Python
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])
Go
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])
}
Rust
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