Skip to content

Instantly share code, notes, and snippets.

  • Save sumonst21/3617c7463f3acaf7f20a237fc2f6df76 to your computer and use it in GitHub Desktop.
Save sumonst21/3617c7463f3acaf7f20a237fc2f6df76 to your computer and use it in GitHub Desktop.
Bash tip: Identify all files and subdirectories consisting of more than 1GB in contents in the current folder

Find large files/subdirectories in current folder

List all files and subfolders consisting of more than 1GB in contents in the current working directory:

du -h -d 1 . | grep 'G\s'

For example, in my backup copy of my old home folder:

∑ du -h -d 1 . | grep 'G\s'
1.4G    ./.android
1.2G    ./Downloads
 12G    ./Library
 17G    .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment