Skip to content

Instantly share code, notes, and snippets.

@amosshapira
Last active December 20, 2015 12:19
Show Gist options
  • Save amosshapira/6130117 to your computer and use it in GitHub Desktop.
Save amosshapira/6130117 to your computer and use it in GitHub Desktop.
Common problem - root file system (or another file system which has other file systems mounted under it) is full and you want to run "du" only on directories which are only on the current file system in order to find the break down of the space users:
#!/bin/bash
find -mindepth 1 -type d -prune |
while read i
do
[[ $(stat -c %m $i) == $(stat -c %m $(pwd)) ]] && echo $i
done |
xargs du -shcx |
sort -h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment