- Notifications
You must be signed in to change notification settings - Fork15
Find build artifacts that are taking up disk space
License
vmchale/tin-summer
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
If you do a significant amount of programming, you'll probably end up withbuild artifacts scattered about.sn
is a tool to help you find thoseartifacts.
sn
is also a replacement fordu
. It has niceroutput, saner commands and defaults, and it even runs faster on big directoriesthanks to multithreading.
Enter the following in a command prompt:
curl -LSfs https://japaric.github.io/trust/install.sh | sh -s -- --git vmchale/tin-summer
If the script doesn't work for you, you can download a binary from thereleasespage.
If your platform doesn't have binaries, or you just want to build from source, getcargo. Then:
$ cargo install tin-summer
Make sure you are on nightly; otherwise
$ rustup run nightly cargo install tin-summer
To list directory and file sizes for the current directory:
$ sn f
To get a list of directory sizes concurrently, excluding version control:
$ sn p --exclude '\.git|\.pijul|_darcs|\.hg'
To get a sorted list of the 12 biggest directories in$DIR
:
$ sn sort $DIR -n12
To search current directory for directories with build artifacts:
$ sn ar
To look for artifacts or directories containing artifacts that occupy more than 200MB of disk space:
$ sn ar -t200M
To turn off colorized output:
export CLICOLOR=0
- Reads disk usage, not just file sizes
- Optionally dereferences symlinks
- Slightly faster on small directories
- Stable and well-supported
- Faster on large directories
- Usesregex for exclusions, making itdramatically faster than
du
when used with the--exclude
flag. - Defaults to human-readable output
- Colorized output
- Nicer help viaclap
- Provides sorted output
- Finds build artifacts
- Reads file sizes, not disk usage
- Extensible in Rust
Directory Size | Tool | Command | Time |
---|---|---|---|
600MB | sn | sn p | 60.74 ms |
600MB | sn | sn d | 99.92 ms |
600MB | du | du -hacd2 | 88.28 ms |
4GB | sn | sn p | 185.2 ms |
4GB | sn | sn d | 271.9 ms |
4GB | du | du -hacd2 | 195.5 ms |
700MB | sn | sn p | 91.05 ms |
700MB | sn | sn d | 176.3 ms |
700MB | du | du -hacd2 | 153.8 ms |
7MB | sn | sn p | 19.48 ms |
7MB | sn | sn d | 12.72 ms |
7MB | du | du -hacd2 | 10.13 ms |
These commands are all essentially equivalent in function, except thatsn p
may use more threads thansn a
ordu
. Results were obtained using Gabriel Gonzalez'sbenchtool. You can see pretty criterion graphshere orhere.
In summary: yes,sn
actually is faster on larger directories, but it is alsoslower on small ones. I'm hoping to make it faster in the future; the currentnaïve concurrency model has obvious directions for improvement.
Currently,sn
looks for files that either have an extension associated withbuild artifacts, or executable files that are ignored by version control. It also looks for "builddirectories", like.stack-work
,elm-stuff
, etc. and if it finds aconfiguration file liketweet-hs.cabal
, it considersall theircontents to be build artifacts.
The following is a list of languagessn artifacts
has been tested with.Theintent is to support basically anything, so feel free to open a PR or start an issue.
- Haskell (incl. GHCJS)
- Rust
- Julia
- Python
- Elm
- Nim
- Vimscript
- TeX
- Idris
- FORTRAN
- Ruby
- C
sn
can clean up your artifacts for you, but only for the above-indicatedlanguages. It is still experimental, but it has been tested and should notdelete unwanted files (though it may not clean everything it should).
About
Find build artifacts that are taking up disk space
Topics
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.