Last active
April 9, 2018 05:05
-
-
Save boywijnmaalen/14b959f476d3ab06485a5e3c94b9271f to your computer and use it in GitHub Desktop.
order directory content by size
This file contains 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
# MAC | |
$ du -sh /directory/to/search/*/ | sort -n -r | |
# UNIX | |
$ du -hc --max-depth=1 . | sort -n -r | |
# du: | |
# -s, --summarize Display only a total for each argument. | |
# -h, --human-readable Append a size letter such as `M' for megabytes to each size. | |
# Powers of 1024 are used, not 1000; `M' stands for 1,048,576 bytes | |
# Use the `-H' or `--si' option if you prefer powers of 1000. | |
# -c, --total | |
# Print a grand total of all arguments after all arguments have been | |
# processed. This can be used to find out the total disk usage of a | |
# given set of files or directories. | |
# | |
# sort: | |
# -n, --numeric-sort compare according to string numerical value | |
# -r, --reverse reverse the result of comparisons |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment