Last active
December 24, 2015 16:28
-
-
Save gdhaworth/6827793 to your computer and use it in GitHub Desktop.
Count processes using files inside a directory, going only 3 subdirectories deep. A lil crazy, I know.
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
watch -n 1 "lsof -F pan /mnt/gentoo 2> /dev/null | grep -Ev '^p' | sed -r '/a./{N;s/^a(.)\nn/\1/}' | cut -d / -f 1,5-8 | grep -Ev '^\s*$' | cut -c 1,3- --output-delimiter=' ' | sort | uniq -c | sed -r 's/ ([0-9]) /0\1 /g' | sort -r" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment