Danalyze is a command-line tool to analyze and display directory contents with sorting and filtering options. This tool lists files in a directory and provides various options to sort the files by size, name, created date, modified date, or extension.
- List files in a specified directory
- Sort files by size, name, created date, modified date, or extension
- Display file sizes in a human-readable format (bytes, KB, MB, etc.)
- Print total size of all files in the directory
You can install Danalyze using Cargo, the Rust package manager. First, ensure you have Rust and Cargo installed. Then, run:
cargo install danalyze
Go to the Releases page and download the binary for your platform. Extract the archive and run the binary from the command line.
After installation, you can run the application from the command line:
danalyze [OPTIONS]
-p, --path <PATH>
: Path of the directory to analyze (default:./
)-o, --ordering <ORDERING>
: Order by (size, name, created_date, modified_date, extension) (default:size
)-d, --order-direction <ORDER_DIRECTION>
: Order direction (asc, desc) (default:asc
)
List files in the current directory, sorted by size in descending order:
danalyze --ordering size --order-direction desc
List files in a specific directory, sorted by name in ascending order:
danalyze --path /path/to/directory --ordering name --order-direction asc
The application will output a table with the following columns:
Name
: The name of the fileSize
: The human-readable size of the fileCreated Date
: The creation date of the fileModified Date
: The last modified date of the fileExtension
: The file extension
Example output:
Path: /path/to/directory
Ordering: size (desc)
Total size: 12.34 MB
+--------------------+----------+---------------------+---------------------+-----------+
| Name | Size | Created Date | Modified Date | Extension |
+--------------------+----------+---------------------+---------------------+-----------+
| file1.txt | 1.23 MB | 01/01/2020 12:00:00 | 01/01/2020 12:00:00 | txt |
| file2.jpg | 5.67 MB | 01/01/2020 12:00:00 | 01/01/2020 12:00:00 | jpg |
| file3.zip | 5.44 MB | 01/01/2020 12:00:00 | 01/01/2020 12:00:00 | zip |
+--------------------+----------+---------------------+---------------------+-----------+
Contributions are welcome! Please open an issue or submit a pull request for any bugs, features, or improvements.
- Add tests
- Add linux and macos binaries