This is ToLGaDrifT's TypePad Profile.
Join TypePad and start following ToLGaDrifT's activity
Join Now!
Already a member? Sign In
ToLGaDrifT
Recent Activity
I'm a Mac nerd and a Unix sysadmin by profession and there's a couple of things I'd like to say here. Firstly, pretty much every command I have seen in the cheatsheets I looked at will work on a Mac. Mac OS X has a very pretty GUI but the power and precision is there hiding underneath as soon as you need it. Secondly, you don't need reams of cheatsheets to perform simple tasks. The tasks that most of the people I work with use would fit on half a sheet of paper and you wouldn't have to use the sheet after an hour's usage. Complex tasks, on the other hand, are a different matter. I was trying to think of something you can't do in the GUI and, thanks to spotlight, there really isn't very much left. The two things I came up with highlight the main two reasons for using the command line: precision and power. With spotlight, I could find references to a particular image in all the html files in my website and open them up for editing. With BBEdit, I could do the same thing but automatically change the image name to its new name. But with a command line I can find all references to this image that are not already wrapped in a link and change both the image to be its thumbnail version and the link to point to the full-sized version or I can add a new link all in one command. The second is a task that I had to perform last week and would have taken me all week in a GUI. Someone (or a piece of malfunctioning software) had deleted a few of the original sized images from a gallery but left the mid-sized images, the thumbnails and all the references to the missing files in place. I wrote a command that would print out a list of all the missing filenames and I can't think of a way of doing that in a GUI that would be quicker than several hours. The greatest power of the command line is in chaining commands together. Practically every day I end up analysing an Apache log file, looking for some pattern that could explain what is happening. Sometimes I want to find the IP addressses with the most requests (cut -d' ' -f1 access_log | sort | uniq -c | sort -n) or I want to find all of the pages that returned 304 response codes (awk '$9 ~ /304/ {print $7}' access_log | sort | uniq) or I want to add up all of the bandwidth used by various different pages and list the top twenty (for PAGE in `cut -d' ' -f7 access_log | sort | uniq`; do awk -v PAGE=$PAGE 'BEGIN {SUM=0} $7 ~ /PAGE/ {SUM=SUM $10} END {PRINT SUM,PAGE}'; done | sort -n | head -20)
Toggle Commented Jan 18, 2011 on Code Kata at CodeKata
ToLGaDrifT is now following The Typepad Team
Jan 18, 2011