A module and command line utility for getting info about disk usage.
Build a main application's entrance point:
go build danalyz.go
Run danalyz binary. In some cases it has to be executed with root privileges.
Required flags:
- path - Path to directory to work with.
- big-dirs - Big directories mode. Returns all subdirectories of given directory, which size is bigger than given max size (max-size flag, gigabytes). Either this flag or dir_struct flag has to be present.
- dir-struct - File structure mode. Returns hierarchical representation of given directory with given depth (depth flag), as well internal files sizes (megabytes). Either this flag or big_dirs flag has to be present.
Optional flags:
- depth - Depth of walk for File structure mode. (default 3)
- max-size - Files with size bigger than this value are considered as large files. (default 1000)
Get subdirectories of /path/to/my/folder bigger than 500gb:
danalyz -path="/path/to/my/folder" -big-dirs -max-size=500
Get hierarchical structure of all subdirectories of /path/to/my/folder with max depth of 10:
danalyz -path="/home/max" -dir-struct -depth=10