From: Christian von Kleist Date: 2007-12-06T01:51:09+09:00 Subject: Ruby equivalent for `du` I wrote a simple method for recursively finding the size of a directory, because I didn't see anything in File::Stat or FileUtils that does that. Am I missing it? Does Ruby already have an equivalent to `du`? def size(f) return File.size(f) unless File.directory?(f) Dir.entries(f)[2..-1].inject(0) {|total, s| total + size(File.join(f, s))} end