Last active
November 15, 2022 10:57
-
-
Save janxkoci/29951cfc47b7ed4ad46b981324b3e118 to your computer and use it in GitHub Desktop.
See size of your top 10 largest files and folders.
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
#!/bin/bash | |
## Takes path as argument ($1) or uses current path instead (.) if no argument given. | |
path="${1:-.}" | |
## Gets size for items in path and reports the top 10 files and folders. | |
du -sh ${path}/* | sort -rh | head -n ${2:-10} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Evgeny uses the following: