Last active
December 20, 2015 12:19
-
-
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:
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 | |
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