A CLI and library for navigating ext2 filesystems
Project description
ext2term
ext2term is a Python CLI tool and library designed to help users learn about the ext2 file system. It simulates a terminal environment, allowing users to interact with the ext2 file system without the need to mount it on their system.
Features
- Navigate Directories: Use familiar commands like
lsandcdto explore the file structure. - View File Contents: Draft ext2-formatted files to your own file system by using
dump. - Extensibility:
ext2termserves as a Python library, making it possible for other developers to include ext2 functionality in their own Python programs.
Installation
pip install ext2term
Usage
ext2term <ext2fs.img>
This will launch a virtual terminal session where you can start interacting with your ext2 file system. Here are some of the commands available:
ls [-l]: List the contents of the cwd.cd DIRECTORY: Change into the specified directory.pwd: Display the current working directory.dump FILE DESTINATION_PATH: Copy a file from the file system to the local file system.exit: Close the session and exit the virtual terminal.
As a Python Library
In addition to being a CLI tool, ext2term is also usable as a library. You can import its classes and utilize them in your own Python code to manipulate or analyze an ext2 file system programmatically.
Here's a snippet showing how you could use ext2term in your code:
from ext2term import Ext2
# Initialize an Ext2 object with the path to your ext2 filesystem
ext2_fs = Ext2('/path/to/ext2fs.img')
# List the contents of the root directory
ext2_fs.ls()
# Change the directory
ext2_fs.cd('some_directory')
# Print the current working directory
ext2_fs.pwd()
Contributing
I'm open to contributions.
License
ext2term is released under the BSD 2-Clause License.
Disclaimer
This tool is for educational purposes only and should not be used on a production environment or to manipulate critical data.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ext2term-0.2.0.tar.gz.
File metadata
- Download URL: ext2term-0.2.0.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfc6a994c15af4e627e01d9e040ee258dbd953f4cac2caa03f1a496ab02bb1e7
|
|
| MD5 |
6c66ea2a14ea33991ead448dd535af92
|
|
| BLAKE2b-256 |
a0647f6a993261acaa23307da51e52d4a82ca1ca4b45ecec92d6685c3805e274
|
File details
Details for the file ext2term-0.2.0-py3-none-any.whl.
File metadata
- Download URL: ext2term-0.2.0-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72d4ea639bbc97c459b4b9d8cadaf0b5857957bc10686e791c6f2b7452d1bb5a
|
|
| MD5 |
632b8e27ffcbe7c95d45db74ab3c7d5f
|
|
| BLAKE2b-256 |
ba296f33cc2f83f70ba0a5b6a8917b08e0851f98a1965f47ac151f3870ec3f5e
|