Skip to content

Instantly share code, notes, and snippets.

@hlorand
Created July 29, 2021 02:41
Show Gist options
  • Select an option

  • Save hlorand/67e156d91dda012afebef02316fe19a7 to your computer and use it in GitHub Desktop.

Select an option

Save hlorand/67e156d91dda012afebef02316fe19a7 to your computer and use it in GitHub Desktop.
Biggest files and folders in bash
# The 500 biggest folders except Google Drive, Trash etc...
sudo du -hx / 2>/dev/null | sort -rh | grep -v "Google Drive" | grep -v "REPOS" | grep -v "Fotókönyvtár" | grep -v ".Trash" | grep -v "CameraUploads" | head -500
# The 500 biggest file that is older than 1 year
sudo find / -type f -mtime +365 -exec ls -laT {} \; 2>/dev/null | awk '{print $5,$9,$10}' | sort -rh | head -500
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment