Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mikermcneil/623238577f0fb8c9c38052fca2f95f86 to your computer and use it in GitHub Desktop.
Save mikermcneil/623238577f0fb8c9c38052fca2f95f86 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