Skip to content

Instantly share code, notes, and snippets.

@thingsiplay
Last active May 24, 2024 00:47
Show Gist options
  • Save thingsiplay/f3bf25b07d5aa2ddd3ceaecebccc92b6 to your computer and use it in GitHub Desktop.
Save thingsiplay/f3bf25b07d5aa2ddd3ceaecebccc92b6 to your computer and use it in GitHub Desktop.
biggest - list biggest files and folders
#!/bin/env bash
# biggest - list biggest files and folders
#
# Usage:
# biggest
# biggest *.png
du --apparent-size --all --max-depth 1 --one-file-system "$@" \
| sort --numeric-sort --ignore-leading-blanks --reverse \
| head --lines $(( $# + 10 ))
| tac
@thingsiplay
Copy link
Author

A beefed up version as a new project: https://github.com/thingsiplay/biggest Does things a bit differently, such as inverted sort (biggest on top) and does not automatically search in directories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment