DirFileShow (fshow
) is a command-line file browser and viewer featuring a rich terminal interface powered by the rich
library. It provides an enhanced alternative to standard commands like ls
, cat
, and dir
for navigating directories and previewing file contents.
- Interactive Navigation: Browse directories using arrow keys, open files or enter directories with
Enter
. Navigate up to the parent directory easily. - Rich Terminal Interface: Utilizes
rich
for clear presentation using tables, panels, and syntax highlighting. - File Preview:
- Displays text-based files with automatic syntax highlighting (Python 🐍, JSON, Markdown 📝, etc.).
- Renders Markdown files directly in the terminal.
- Provides a hexadecimal view 👾 for binary files.
- Option to open non-text files (e.g., images 🖼️) using the system's default application.
- Detailed Information: Shows file metadata including size, modification date, MIME type, permissions, and calculates MD5/SHA1/SHA256 hashes 🔍.
- Directory Statistics: Analyzes directory contents to display total size, item counts, size distribution by file extension, and lists the largest files 📊.
- Integrated Search: Recursively search for files and directories by name within the current path 🕵️♀️.
- Customization:
- Selectable color themes 🎨 for syntax highlighting.
- Toggle visibility of hidden files (
.dotfiles
) 👁️. - Sort directory listings by name, type, size, or modification date (ascending/descending) ⇅.
- File Type Icons: Uses Unicode icons (e.g., 📁, 📄, 🐍, 🎵, 🎬, 📦) for quick identification.
- Pagination: Handles large directories by displaying content in pages 📖.
- Cross-Platform: Compatible with Linux 🐧, macOS 🍎, and Windows 🪟.
- Prerequisites: Requires Python 3.x 🐍.
- Obtain the script: Download the
fshow.py
file. - Install dependencies: The primary dependency is
rich
.(Using a virtual environment is recommended:pip install rich
python -m venv venv && source venv/bin/activate
) - (Optional) Make globally accessible:
- Ensure the script is executable:
chmod +x fshow.py
. - Move
fshow.py
to a directory in your system'sPATH
, renaming it tofshow
:mv fshow.py ~/.local/bin/fshow # Ensure ~/.local/bin is in your PATH environment variable
- Ensure the script is executable:
If installed globally (step 4 above), invoke using:
Enter a Folder with fshow:
fshow ([FOLDER PATH])
View a File:
fshow --file [FILE PATH]
Enter fshow menu's:
fshow
Key Action
↑
/↓
Navigate list entries←
/→
Navigate pages (for long listings)Enter
Enter selected directory / Preview selected file- Select
..
+Enter
Go to parent directory Tab
Access context menu (Statistics, Hex View, etc.)/
Initiate search within the current directoryh
Toggle visibility of hidden filess
Change sorting criteria (name, type, size, date)r
Refresh the current viewf
Toggle favorite status (basic implementation)⭐q
Quit DirFileShow (fshow)
Default settings (theme, hidden file visibility, sort order) are defined in the CONFIG dictionary at the beginning of the fshow.py script. These can be modified directly in the source file.
CONFIG = {
"theme": "monokai",
"show_hidden": False,
"sort_by": "name",
"reverse_sort": False,
# ... other settings
}
- Python 3.x
- Rich library (pip install rich)
Contributions are welcome. Please follow standard practices such as:
- Forking the repository (if applicable).
- Creating feature branches (git checkout -b feature/YourFeature).
- Committing changes (git commit -m 'Add YourFeature').
- Pushing to the branch (git push origin feature/YourFeature).
- Opening a Pull Request. Alternatively, open an issue to report bugs or suggest features.
This project is distributed under the MIT License (confirm or specify actual license).