Skip to main content

ext4-cli

Read ext4 filesystems from image files and block devices — without mounting them.

Quick start

# Install (pick one)
cargo install ext4-cli          # From crates.io
pip install ext4-cli            # Via pip
uvx ext4-cli --help             # Run without installing (via uv)

# Use
ext4 --source disk.img ls /etc
ext4 --source disk.img cat /etc/fstab
ext4 --source disk.img cp /etc /tmp/etc-backup -r

Installation

From crates.io

cargo install ext4-cli

From PyPI

pip install ext4-cli
# or run without installing:
uvx ext4-cli ls /

From Homebrew

brew install rvben/tap/ext4

From GitHub releases

Pre-built binaries for Linux (x64, arm64) and macOS (x64, arm64) on the releases page.

Usage

All commands require a source — an ext4 image file or raw block device — via --source or the EXT4_SOURCE environment variable:

export EXT4_SOURCE=/dev/rdisk4s2
ext4 ls /

Commands

ls — list directory contents

ext4 --source disk.img ls                     # List root directory
ext4 --source disk.img ls /etc                # List /etc
ext4 --source disk.img ls -l /etc             # Long format (permissions, uid, gid, size)
ext4 --source disk.img ls -a /etc             # Include dotfiles
ext4 --source disk.img ls --json /etc         # JSON output

cat — print file contents

ext4 --source disk.img cat /etc/fstab
ext4 --source disk.img cat /etc/passwd

cp — extract files

ext4 --source disk.img cp /etc/fstab ./fstab          # Extract a file
ext4 --source disk.img cp /etc /tmp/etc-backup -r     # Extract a directory tree

stat — show file metadata

ext4 --source disk.img stat /etc/fstab
ext4 --source disk.img stat --json /etc/fstab

info — show filesystem metadata

ext4 --source disk.img info
ext4 --source disk.img info --json

Raw block devices (macOS)

On macOS, use the raw disk path (/dev/rdisk*) for better performance. Reading raw block devices requires root access:

sudo ext4 --source /dev/rdisk4s2 ls /

Exit codes

Code Meaning
0 Success
1 General error
2 Permission denied
3 Path not found

Development

make fixtures   # Generate test fixtures (requires e2fsprogs)
make test       # Run tests
make lint       # Run fmt + clippy
make install    # Build and install

License

MIT OR Apache-2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ext4_cli-0.0.4.tar.gz (56.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ext4_cli-0.0.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (567.2 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

ext4_cli-0.0.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (539.0 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

ext4_cli-0.0.4-py3-none-macosx_11_0_arm64.whl (515.5 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

ext4_cli-0.0.4-py3-none-macosx_10_12_x86_64.whl (535.2 kB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file ext4_cli-0.0.4.tar.gz.

File metadata

  • Download URL: ext4_cli-0.0.4.tar.gz
  • Upload date:
  • Size: 56.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ext4_cli-0.0.4.tar.gz
Algorithm Hash digest
SHA256 f2f06442d6feb0f4c5eeb089683e1af776320c1a71e440ca7e579ade0d34be0e
MD5 1b5824df641f9270c087b3da753d4394
BLAKE2b-256 aac4dd98573cb4ca3dd82cee6600c2c9a0335e5018558bf6d3aaf9c7bdb148e3

See more details on using hashes here.

File details

Details for the file ext4_cli-0.0.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: ext4_cli-0.0.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 567.2 kB
  • Tags: Python 3, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ext4_cli-0.0.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4760ff91a4a9ded69f80a6b0311d0f09b5586e9281be9efabc764902451d2b80
MD5 a1bd05ddec50eadf1f765bccacad2f79
BLAKE2b-256 239c2bbb6afed811f3e11f86eacc03086d519dcffde1f6fc2da72daae81f975c

See more details on using hashes here.

File details

Details for the file ext4_cli-0.0.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

  • Download URL: ext4_cli-0.0.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
  • Upload date:
  • Size: 539.0 kB
  • Tags: Python 3, manylinux: glibc 2.17+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ext4_cli-0.0.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7d4feb6386a20dcf9ca8fc8674dfa6f07b68a0040595d9a7d64fea9a54b024f3
MD5 2c50db792adb563dd35cc3f196e2927f
BLAKE2b-256 f8c310ff4bcd7b8e8804f37fe17eb791f8863d83ddd73cc6725b3fdedde0ee2e

See more details on using hashes here.

File details

Details for the file ext4_cli-0.0.4-py3-none-macosx_11_0_arm64.whl.

File metadata

  • Download URL: ext4_cli-0.0.4-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 515.5 kB
  • Tags: Python 3, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ext4_cli-0.0.4-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 46a5401b4d69b6e61ac3f0e9787a6c45a497451bea2b4370649d4cd495046fab
MD5 2797d7b614964badf17017056cd625a9
BLAKE2b-256 7bbe1cd051e303ea89bee260d5a55ce3464da67bfad8ea144f8669fd5948b45c

See more details on using hashes here.

File details

Details for the file ext4_cli-0.0.4-py3-none-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: ext4_cli-0.0.4-py3-none-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 535.2 kB
  • Tags: Python 3, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ext4_cli-0.0.4-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 1a160d7d43ee55102aa0bbc262bd4e662affd11d60db2151f52201fce0850167
MD5 26bf425689934706b38efb1f48306272
BLAKE2b-256 a791ae2713cdbfea3514d7ecc41e17d50e3a128ae8c63761a6169ca03e0e4ab1

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.5

5 files

This release

0.0.4 This release

5 files

0.0.3

5 files

0.0.2

5 files

0.0.1

5 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page