A lightweight and fast CLI tool written in C++ that lists and manages files in a directory structure. The tool allows recursive iteration, detailed file information, and customized display with several flags.
- Recursive Directory Traversal: Traverse directories recursively with the
-rflag. - File Information: Get detailed information about file permissions, ownership, size, and modification time with the
-lflag. - Hidden Files: List hidden files (starting with
.) with the-aflag. - Directory-only View: List only directories with the
-dflag. - Human-readable Size: Display file sizes in a human-readable format with the
-mflag. - No Icons: Disable icons for directories with the
-xflag.
Ensure you have the following dependencies installed:
- C++ compiler (GCC/Clang)
- Boost Filesystem Library
- Boost Program Options Library
To install the tool, clone the repository and build the project:
git clone https://github.com/Deyan2306/ds.git
cd ds
makeTo install the tool globally:
sudo make installTo uninstall:
sudo make uninstallRun the ds command followed by optional flags to list files in a directory.
ds [options]If no path is provided, the tool defaults to the current working directory.
The following flags can be passed to customize the output:
| Flag | Description |
|---|---|
-h, --help |
Show help message and usage. |
-p, --path |
Specify the path to the directory (default is current directory). |
-a, --all |
Show hidden files. |
-l, --long |
Show detailed information including permissions, owner, size, etc. |
-r, --recursive |
Recursively list files and directories. |
-m, --human_readable |
Show sizes in human-readable format (e.g., KB, MB). |
-d, --directories_only |
Only display directories in the output. |
-x, --no_icons |
Do not display icons for directories. |
-
Basic Listing:
ds
Lists all files and directories in the current directory.
-
List with Hidden Files:
ds -a
-
List with Detailed Information:
ds -l
-
Recursive Listing:
ds -r
-
Human-Readable Sizes:
ds -l -m
You could also chain commands like so:
ds -lamx
You can modify the project or rebuild it by using the provided Makefile.
To clean up the build:
make cleanTo build and install the project:
make
sudo make installTo uninstall:
sudo make uninstallThis project is licensed under the MIT License. See the LICENSE file for details.