Tuesday, January 12, 2010

Count number of files of certain size

find ./ -size 0k | grep "sess_" -c

This finds the files and directories matching a path and matching a size.
Can use -size +[number]k (above a certain size) or -size -[number]k (below a certain size), or a size match.
Then it pipes that to a grep for the word "sess_" and returns a count.
Helps us count the enormous number of blank sessions that our app is generating on OSX.

No comments:

Post a Comment