Monthly Archives: July 2010

find and awk for httpd owned files (with count and average)

These are not very efficient (two sorts in one line for example) but for my needs work fine (improvements welcomed). Create a list of “filenames|size in bytes” of all httpd owned files sorted by reverse size: find “/path/to/examine/” -user httpd -type f -printf ‘%p|%s\n’ | sort -t \| +1 -2 > httpd.usage.txt results: /path/to/examine/some/user/files/file0.jpg|99995 /path/to/examine/some/user/files/file7.jpg|99994 [...]

Posted in code snippets, geek, servers & tech | Leave a comment