Created
January 15, 2025 02:09
-
-
Save stefanlasiewski/bf2e9c33460808ab3a05298d0ba9ad4e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Show the 20 largest files in a directory | |
# Borrowed from http://oreilly.com/pub/h/15 | |
#set -x | |
set -euo pipefail | |
# du options | |
# -x File system mount points are not traversed. | |
# .[^.]* Include dotfiles, exclude '.' & '..'. Note that '--exclude' is not supported on a Mac | |
# $* Allow extra grep options, like '-n' | |
# Summarize disk space usage into a local file called .ducks | |
#nongnu# du -cks -x $* .[^.]* * | sort -n > .ducks ; tail .ducks | |
du -chs -x $* .[^.]* * | sort -h > .ducks ; tail .ducks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment