Created
June 9, 2016 00:20
-
-
Save tuxedocat/2b3576a1ba66284dafc07fb00c0e6354 to your computer and use it in GitHub Desktop.
Counts num. of inodes in given directory, writes (n_inodes path) as report, and shows total num. of inode usage.
This file contains hidden or 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 $1 -xdev -printf '%h\n' | | |
sort | | |
uniq -c | | |
sort -k 1 -n -r | | |
tee inodeusage | | |
tr -s " " | | |
cut -f 2 -d " " | | |
python -c"import sys; print(sum(map(int, sys.stdin)))" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment