Command line tools for the novice

Filed under: web development

comments (16) Views: 26,135

I've always had a healthy skepticism about the command line. It seemed like too much magic in soo little typing. Watching my friend Matt Telnet into his mail server using PINE (Pine is Not Elm) instead of using AOL, the programmers at my first web job installing entire operating systems with just a few typed commands into a terminal window. And most recently the Rails dudes generating entire websites with a single cryptic line of code. It wasn't until I started using my MacBook for daily developing that my viewpoint really changed. Seeing the sort of quick configurations that were possible in the Terminal window really changed my mind about it, and now I guess you might say that I'm a junkie. This post is dedicated to sharing a few of the tools and commands I use daily that really improve my workflow and save me time.

iTerm2 - free

Any conversation about using the command line needs to start with a good terminal window. iTerm2 for the Mac is free and it's top notch. It supports tabbed interfaces, split panes, multiple profiles (different settings depending on what you're doing), and bookmarks. You can style and color it any way you like, and when used in conjunction with the next tool it really makes your command line environment unique.

Zsh - free

The command line is the entry point into the inner workings of your computer, and the doorway is your "shell". There are a number of different shells available and their use is generally based on personal preference. The Mac OS defaults to the Bash shell, but there's a better option: ZSH. ZSH acts very much like the Bash shell so you'll feel right at home. But right away you'll start noticing subtle improvements. Zsh will correct commonly misspelled words and commands. Its tab-completion not only shows you what's available but allows you to choose it using the arrows (or just continue pressing tab)! Zsh will share your command history across multiple terminal windows. There's lots more, but since Zsh is free and easy to install, you should check it out. But before you do, read through the next item, as there's an easier way...

Oh My Zsh - free

Oh My Zsh is a set of community managed tools for use with Zsh. It includes a lengthy list of plugins and themes that will really make Zsh sing. Plus, if you install Oh My Zsh using Git, it'll automatically set up Zsh for you. Two for one! Not a bad deal. Oh My Zsh is a no brainer if you've decided to give Zsh a try.

Z - free

Not to be confused with Zsh or Oh My Zsh, Z is a simple command line utility that does one thing, and does it very well. Z runs in the background and records every directory that you cd into. It then compiles a weighted list of the most frequently (and recently) used and presents them to you. Tired of typing cd ~/Sites/clients/ all the time? Cd into that directory enough times and you'll be able to type any part of the path after "z" and jump straight there. z search and you're there baby!

Ack - free

Ack is a command line tool which allows you to sift through files and folders for your desired search term. If you're already familiar with grep, then you can use Ack with zero additional effort. Ack is fast, flexible and offers a better set of default functionality than Grep. For example you want to search through all the files in your website for a CSS class name. In Grep grep -R 'some term' *, in Ack ack 'some term'. The -R tells grep to search through all directories and subdirectories while the * tells it what types of files. Yes, it's only a few characters, but time is Ack is 4 or 5 times faster than grep.

cURL - free

cURL is included with OS X and it's an excellent utility which lets you interact with URLs via the command line. You can grab the contents of a JavaScript file and save it to your local machine:
curl -o /path/to/local/file.js

Or you could get your remote IP address:

You can even GET/POST to a URL using cURL

server - free

Thanks to Paul Irish for this one. This is a handy function that you can run that starts up a simple Python web server in the current directory. It's a quick way to view files in a server's context and not have to worry about your browser complaining about loading local files. On a side note, this video with Paul Irish is an excellent example about being in love with the tools you use.

function server() {
	local port="${1:-8000}"
	open "http://localhost:${port}/"
	python -m SimpleHTTPServer "$port"

So there's 7 for you, but there's an almost unlimited number of other tools and utilities out there that can improve efficiency, workflow, and save your sanity. If you've ever thought "there must be a better way", then there probably is. Go forth and find it!

Amazon logo

If this article was interesting, or helpful, or even wrong, please consider leaving a comment, or buying something from my wishlist. It's appreciated!

comments powered by Disqus
coach outlet online jordan 13 grey toe beats by dre cyber monday michael kors black friday beats by dre cyber monday jordan 6 black infrared north face cyber monday michael kors cyber monday north face black friday coach outlet black infrared 23 13s north face cyber monday jordan 6 black infrared north face black friday coach cyber monday jordan 11 legend blue north face cyber monday black infrared 6s lebron 12 north face black friday jordan 11 legend blue louis vuitton outlet jordan 13 grey toe grey toe 13s beats by dre black friday coach black friday jordan 13 grey toe coach cyber monday uggs black friday jordan 13 black infrared 23 uggs cyber monday barons 13s uggs black friday beats by dre cyber monday black infrared 6s jordan 13 bred jordan 13 black infrared 23 north face black friday black infrared 6s jordan 11 legend blue michael kors black friday jordan 13 grey toe coach black friday michael kors black friday michael kors cyber monday beats by dre cyber Monday north face cyber monday coach black friday michael kors cyber monday beats by dre cyber Monday north face black friday beats by dre black friday lululemon black friday uggs black friday jordan 13 bred coach cyber monday beats by dre black friday uggs black friday coach black friday black infrared 6s