https://github.com/guumaster/dir-cleaner
A golang CLI to scan and clean directories (mainly node_modules)
https://github.com/guumaster/dir-cleaner
Last synced: over 1 year ago
JSON representation
A golang CLI to scan and clean directories (mainly node_modules)
- Host: GitHub
- URL: https://github.com/guumaster/dir-cleaner
- Owner: guumaster
- License: mit
- Created: 2020-03-03T08:22:35.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-07T19:37:38.000Z (over 6 years ago)
- Last Synced: 2025-02-17T09:42:48.882Z (over 1 year ago)
- Language: Go
- Size: 3.04 MB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/guumaster/dir-cleaner/actions?query=workflow%3ATest)
[](https://github.com/guumaster/dir-cleaner/releases)
[](https://goreportcard.com/report/github.com/guumaster/dir-cleaner)
[](https://github.com/guumaster/dir-cleaner/LICENSE)
# Dir Cleaner
A simple tool to scan and remove unwanted directories from your system.
It may takes between 10 or 15 seconds if you pass a path 200Gb and 2 million files. It's really fast if you narrow the search.
It was used as a demo on our internal Golang program. It contains different versions with improvements.
## Installation
Go to [release page](https://github.com/guumaster/dir-cleaner/releases) and download the binary you need.
## Examples to remove all node_modules
```bash
$> dir-cleaner --path / --pattern node_modules
// Output:
Path: [/]: Scanned 2,045,830 files. Matched 254,183 in 2,731 directories. [1.9 GB]
```
## Usage
NAME:
dir-cleaner - remove your unused files on your system
USAGE:
dir-cleaner [--path ] [--depth ] [--dry-run] [--pattern [--pattern ]]
VERSION:
1.0.0
AUTHOR:
Guumaster
COMMANDS:
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--path value, -p value path where to start the search (default: "$PWD")
--pattern value pattern to search (can be repeated for multiple patterns)
--dry-run just check without deleting data (default: false)
--max-depth value, -d value how many levels to check (use 0 for no max depth) (default: 0)
--bytes count bytes instead of default blocks of 4K to match 'du' reports (default: false)
--verbose print more info into the console (default: false)
--help, -h show help (default: false)
--version, -v print the version (default: false)
### Dependencies & Refs
* [dustin/go-humanize](https://github.com/dustin/go-humanize)
* [urfave/cli](https://github.com/urfave/cli)
### LICENSE
[MIT license](LICENSE)
### Author(s)
* [guumaster](https://github.com/guumaster)