• Stars
    star
    306
  • Rank 136,456 (Top 3 %)
  • Language
    Rust
  • License
    BSD 3-Clause "New...
  • Created over 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Find build artifacts that are taking up disk space

The Tin Summer

Windows build status Build Status

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 artifacts.

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.

Installation

Script

Enter the following in a command prompt:

curl -LSfs https://japaric.github.io/trust/install.sh | sh -s -- --git vmchale/tin-summer

Binary install

If the script doesn't work for you, you can download a binary from the releases page.

Cargo

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

Use

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

Accessibility

To turn off colorized output:

export CLICOLOR=0

Comparison (or, 10 Things I Hate About du)

Reasons to use du

  • Reads disk usage, not just file sizes
  • Optionally dereferences symlinks
  • Slightly faster on small directories
  • Stable and well-supported

Reasons to use sn

  • Faster on large directories
  • Uses regex for exclusions, making it dramatically faster than du when used with the --exclude flag.
  • 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

Benchmark results

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 that sn p may use more threads than sn a or du. Results were obtained using Gabriel Gonzalez's bench tool. You can see pretty criterion graphs here or here.

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.

Screenshots (alacritty + solarized dark)

The Tin Summer

Displaying a user's timeline in a terminal.

du

Displaying a user's timeline in a terminal.

Heuristic for build artifacts

Currently, 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 directories", like .stack-work, elm-stuff, etc. and if it finds a configuration file like tweet-hs.cabal, it considers all their contents to be build artifacts.

Languages Supported

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)
  • Rust
  • Julia
  • Python
  • Elm
  • Nim
  • Vimscript
  • TeX
  • Idris
  • FORTRAN
  • Ruby
  • C
Autoclean

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).

More Repositories

1

polyglot

Tool to count lines of source code.
ATS
234
star
2

project-init

Project templates in rust
Rust
129
star
3

command-line-tweeter

Tweets in from a pipe
Haskell
71
star
4

dhall-vim

Syntax highlighting for Dhall
Vim Script
67
star
5

jacinda

Functional, expression-oriented data processing language
Haskell
66
star
6

cpkg

A build tool/package manager for C, configured with Dhall
Dhall
65
star
7

recursion_schemes

Recursion schemes for Idris
Idris
60
star
8

kempe

Kempe is a compiled stack-based language
Haskell
56
star
9

github-actions-dhall

Dhall helpers for github actions
Dhall
55
star
10

madlang

Madlang is a language for generative literature
Haskell
52
star
11

atspkg

Build tool for ATS.
Haskell
41
star
12

apple

Apple array system
Haskell
37
star
13

permutations

Provides a type-safe way of working with permutations in Idris
Idris
30
star
14

dickinson

Text generation language
Haskell
28
star
15

tomlcheck

A syntax checker for TOML files
Haskell
28
star
16

vim-twitter

Tweet from inside vim!
Vim Script
27
star
17

libmeme

A library for inserting clap emoji into strings
Haskell
25
star
18

hs-ats

Home of the fast-arithmetic library for number theory in ATS and Haskell.
ATS
22
star
19

tw-rs

Command-Line Interface Tweeter, for rust
Rust
19
star
20

rure

Haskell bindings to Rust's regex library
Haskell
17
star
21

coronavirus

covid-19 data in J
J
16
star
22

EMD

Earth mover's distance on Nvidia GPUS
Haskell
14
star
23

doggo-command-line

Compliment your dog
Rust
13
star
24

just-vim

Syntax highlighting for Justfiles
Vim Script
13
star
25

phash

Perceptual hashing command-line tool
Haskell
13
star
26

linear

Linear lenses in Blodwen
Idris
13
star
27

ion-vim

Syntax highlighting for the ion shell
Vim Script
13
star
28

libarchive

Haskell bindings to libarchive
C
12
star
29

recursion-schemata

Generate fake recursion schemes
Haskell
12
star
30

pybqn

BQN↔NumPy bridge
C
12
star
31

edit-distance

Levenshtein edit distance, packaged for ATS
ATS
11
star
32

ats-format

ATS source code formatter
Haskell
11
star
33

j-hs

Call J from Haskell
Haskell
11
star
34

shake-dhall

Facilities for using Shake + dhall
Haskell
10
star
35

cpp-build

Use the C pre-processor on Rust projects
Rust
10
star
36

ghc-cross

aarch64 and armv7 cross-compilers
9
star
37

morphism-zoo

Some examples of recursion schemes, with benchmarks
Haskell
9
star
38

ipkg-vim

Syntax highlighting for Idris package files
Vim Script
9
star
39

ats-stats

Demonstration of GPU-accelerated statistical functions in ATS
ATS
9
star
40

kullback-liebler

Kullback-Liebler divergence in Futhark
Futhark
8
star
41

language-xats

Language library for manipulating ATS3 in Haskell.
Haskell
8
star
42

recursion

Recursion schemes in ATS
ATS
8
star
43

spherical

Library for spherical geometry in Haskell
Haskell
8
star
44

ats-benchmarks

Benchmarks of ATS compared to Rust and Haskell
Haskell
8
star
45

ats-concurrency

Concurrency primitives for ATS
ATS
8
star
46

hlint-lib

Library containing some standard HLint helpers
Dhall
7
star
47

pi-templates

Templates for pi
Haskell
7
star
48

perceptual-hash

Perceptual Hash in J
J
7
star
49

monads

Monads for viewtypes in ATS
ATS
7
star
50

hgis

Haskell as a GIS
Haskell
6
star
51

archive-backpack

Demonstration of backpack to enable substitution of tar/libarchive functionality
Haskell
6
star
52

pointfree

Wrapper of pointfree command-line tool for Haskell
Vim Script
6
star
53

hask-replace

Command-line tool to rename modules in Haskell projects
Rust
6
star
54

cabal-project-vim

Syntax highlighting for `cabal.project` files.
Vim Script
6
star
55

miso

Miso project template for GHCJS 8.6
Haskell
5
star
56

tokei-vim

Vim plugin for of tokei
Vim Script
5
star
57

linkedin-madlibs

Source for linkedin article generator
Haskell
5
star
58

brainheck

Brainh*ck intrepreter in haskell.
Brainfuck
5
star
59

haskell-ats

Template project for mixing Haskell and ATS
Haskell
5
star
60

ghci-syntax

Syntax highlighting for ghci configuration files
Vim Script
5
star
61

egison-vim

Vim syntax highlighting for Egison
Vim Script
4
star
62

avif

libavif bindings for Haskell
Haskell
4
star
63

img-fut

Image manipulation in Futhark
Futhark
4
star
64

QR-writer

Haskell library for writing QR codes to file
Haskell
4
star
65

crc32

CRC32 implementation in ATS
ATS
4
star
66

hackage-fetch

Fetch every single package on Hackage, using Python + shell madness
Haskell
4
star
67

markov-bot

Make a twitter bot from any corpus of text you desire
Python
4
star
68

viminit

Python script to initialize a vim project
Python
4
star
69

tibetan-utils

Utils for tibetan numerals in Haskell
Haskell
4
star
70

elliptic-fourier

Elliptic Fourier series in J
J
4
star
71

xmonad-vanessa

Xmonad configuration
Haskell
4
star
72

recursion-schemes-benchmarks

Benchmarks of Fibonacci functions built with recursion schemes vs. pattern matching.
Haskell
3
star
73

composition

Composition extras for Idris
Idris
3
star
74

ats-codecount

Code counter experiment in ATS
ATS
3
star
75

sql-qq

Syntax highlighting for quasi-quotes within Haskell.
Vim Script
3
star
76

madlang-miso

Frontend project template with madlang
Haskell
3
star
77

illiterate

Preprocessor for literate programming
Shell
3
star
78

hot-takes

Programming opinion generator
Haskell
3
star
79

either

Port of Data.Either for ATS
ATS
3
star
80

q-bench

benchmarks of q(-sql)
R
3
star
81

oeis

OEIS functions in Haskell
Haskell
3
star
82

cli-setup

Helper scripts to install manpages alongside a command-line tool.
Rust
3
star
83

dir-traverse

Recursive directory traversals in Haskell
Haskell
2
star
84

phash-fut

Perceptual hash in Futhark
Python
2
star
85

elm-composition

Port of Haskell's composition library to Elm
Elm
2
star
86

pathological-bytestrings

Facilities for testing with ByteStrings
Haskell
2
star
87

lzlib

lzlib bindings for Haskell
Haskell
2
star
88

debug-dump

Like Debug.Trace, but allows writing to files
Haskell
2
star
89

ats-wc

Demonstration of packaing for ATS + faster/safer version of coreutils
ATS
2
star
90

basic-recursion

Basic recursion schemes in Blodwen
2
star
91

comonad

Comonads for Idris
Idris
2
star
92

NonEmpty

NonEmpty type for Dhall
Dhall
2
star
93

haskal

How to write Haskal good
Haskell
2
star
94

librarian

Tools to manage a home library
Haskell
2
star
95

tibetan-typing

An Elm app that teaches typing for Tibetan and Dzongkha.
Elm
2
star
96

ats-storable

ATS storable instance
Haskell
1
star
97

ppp

Permutations in PureScript
PureScript
1
star
98

specats

Bare-bones unit testing library for ATS
ATS
1
star
99

safe-bytecount

Safe bytecount demo in ATS
ATS
1
star
100

matrix-benchmarks

Matrix benchmarks for J/Python
J
1
star