dirsize
is a Go utility for calculating directory sizes. It provides a simple command-line interface to measure the size of directories, with options for recursive calculation and human-readable output.
- Calculate the size of one or more directories
- Recursive mode for including subdirectories
- Human-readable output option
- Concurrent processing for improved performance
- Go 1.x or higher
-
Clone the repository:
git clone https://github.com/vinodhalaharvi/dirsize.git cd dirsize
-
Build the project:
make build
-
(Optional) Install golangci-lint and other tools:
make install-tools
After building the project, you can run dirsize
as follows:
./dirsize [flags] [directories...]
-recursive
: Calculate sizes recursively (include subdirectories)-human
: Display sizes in human-readable format
Calculate the size of the current directory:
./dirsize .
Calculate the sizes of multiple directories recursively with human-readable output:
./dirsize -recursive -human /path/to/dir1 /path/to/dir2
To run the test suite:
make test
To run the linter:
make lint
To run all quality checks (lint, vet, and test):
make quality
Contributions to dirsize
are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.