Category Archives: Shell tricks

Stupid Unix/shell hacks (aka unixtrix)

tcpdump

Using tcpdump: tcpdump -A -i en1 -s0 Continue reading

Posted in Nerdliness, Shell tricks | Tagged , , , | Comments Off on tcpdump

Unixtrix: Backup

I back up my files remotely using rsync. For the Mac Erin and I share, on which we keep gobs of pictures, video, and the like, that’s not feasible given our limited bandwidth. Erin is good at archiving files to … Continue reading

Posted in Nerdliness, Shell tricks | Tagged , , , , | 6 Comments

Unixtrix: dump URL to a local file

curl -O -C – http://wrecking.org/404.jpeg wget -c http://wrecking.org/404.jpeg Context: Someone emailed me a nifty Flash object, and I wanted a copy. Explanation: These commands do the same thing: grab the URL indicated and dump it to a local file with … Continue reading

Posted in Nerdliness, Shell tricks | Comments Off on Unixtrix: dump URL to a local file

Unixtrix: Word frequency in plaintext

perl -pe “tr/[A-Z]/[a-z]/; s/[\!\/\[\];?\’\”,\-\$\.\(\)]/ /gs; s/ +/\n/g;” < sotu2007.text | sort | uniq -c | sort -nr > sotu2007freq.text Context: David Banash and I wanted to see what issues are on the radar at WIU, based on the content of … Continue reading

Posted in Shell tricks | Comments Off on Unixtrix: Word frequency in plaintext

Unixtrix: calculate size of all files of given extension

find . -name “*.AVI” -print0 | xargs -0 du -ch Context: cleaning up Erin’s Mac (more on that soon), I want to find out how much space is taken up by iPhoto movie files. iPhoto has crappy search features (read: … Continue reading

Posted in Meta, Nerdliness, Shell tricks | 2 Comments