Skip to content
therrick edited this page May 29, 2014 · 5 revisions

Find total size of files with a given extension: ls -ltR | grep \.zip | awk '{tot += $5} END {tot=tot/1024 ; printf(" TOTAL SIZE (kb): %4.2f\n",tot)}'

Find largest dirs > 500MB (mac): du -k ~/* | awk '$1 > 500000' | sort -nr

Files including one string but not another: grep -l <string-to-match> <filespec> | xargs grep -L <string-not-to-match>

dtrace

ls -aFl /usr/sbin/dtrace
sudo chmod u+s /usr/sbin/dtrace
dtruss <command>
(strace on linux)
Clone this wiki locally