98 stable releases
|1.21.6||Aug 22, 2018|
|1.21.5||Jul 17, 2018|
|1.21.4||Jun 10, 2018|
|1.21.1||Feb 3, 2018|
|1.11.3||Jul 29, 2017|
#10 in Command line utilities
1,498 downloads per month
If you do a significant amount of programming, you'll probably end up with
build artifacts scattered about.
sn is a tool to help you find those
sn is also a replacement for
du. It has nicer
output, saner commands and defaults, and it even runs faster on big directories
thanks 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 the releases page.
If your platform doesn't have binaries, or you just want to build from source, get cargo. 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
$ 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:
- Reads disk usage, not just file sizes
- Optionally dereferences symlinks
- Slightly faster on small directories
- Stable and well-supported
- Faster on large directories
- Uses regex for exclusions, making it
dramatically faster than
duwhen used with the
- Defaults to human-readable output
- Colorized output
- Nicer help via clap
- Provides sorted output
- Finds build artifacts
- Reads file sizes, not disk usage
- Extensible in Rust
These commands are all essentially equivalent in function, except that
may use more threads than
sn a or
du. Results were obtained using Gabriel Gonzalez's bench
tool. You can see pretty criterion graphs
In summary: yes,
sn actually is faster on larger directories, but it is also
slower on small ones. I'm hoping to make it faster in the future; the current
naïve concurrency model has obvious directions for improvement.
sn looks for files that either have an extension associated with
build artifacts, or executable files that are ignored by version control. It also looks for "build
elm-stuff, etc. and if it finds a
configuration file like
tweet-hs.cabal, it considers all their
contents to be build artifacts.
The following is a list of languages
sn artifacts has been tested with.
The intent is to support basically anything, so feel free to open a PR or start an issue.
- Haskell (incl. GHCJS)
sn can clean up your artifacts for you, but only for the above-indicated
languages. It is still experimental, but it has been tested and should not
delete unwanted files (though it may not clean everything it should).