https://github.com/orc/sorth
A q&d size sorter for the output of du -h
https://github.com/orc/sorth
Last synced: 11 months ago
JSON representation
A q&d size sorter for the output of du -h
- Host: GitHub
- URL: https://github.com/orc/sorth
- Owner: Orc
- License: other
- Created: 2020-08-01T17:19:54.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2020-08-01T20:03:46.000Z (almost 6 years ago)
- Last Synced: 2025-02-24T13:13:15.105Z (over 1 year ago)
- Language: C
- Size: 7.81 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
The default output from `du` is sortable, but not particularly readable.
The output from `du -h`, on the other hand, is quite readable, but not
sortable.
Let's fix this with a mindbogglingly horrible late-night bit of code!
`sorth` is meant to do one thing, and one thing well enough. It
takes the raw output from `du -h` and sorts it by actual size (small
to large; other text is sorted to the top of the list.)
It takes one optional argument. `sorth -r` sorts in reverse order.
To build `sort`, `make && make install` If your system has the bsd
`fgetln` function in stdio, you need to do `make CFLAGS=-DHAS_FGETLN`
and if you want to install the binary somewhere other than the default,
`make BINDIR={your bin} install`