109
votes

I've just read with pleasure, and learned a lot from these questions :

But I didn't find in these some of my favorites tools, which I use on a daily basis, and I think that's because these are OSX/Terminal intended tools, not fitting well in above questions.

My favorites are, by order of preference: oh-my-zsh, homebrew (but also macports), janus...

These tools having in common :

  • Terminal: install and use
  • OSX Intended: brew is, git is not!
  • Easy Install: one liner, ie. git clone; wget ... etc.
  • Extensible: possibly has extensions or simple API (eg. oh-my-zsh with plugins, brew with formulas, janus with bundled vim plugins...)
  • Often open source, free, hosted on github, scripted, mostly (but not only!) with ruby...

Do you know any other similar must-have tools? I would love to discover new ones!

Please only include one utility per answer. Also, please don't add duplicates. Check first before posting. If you see a duplicate, kindly downvote the answer and inform the author by leaving a comment.

4
  • homebrew and macports together could have issues as macports will read files installed by homebrew and they will not necessarily be the correct version
    – mmmmmm
    Apr 16, 2011 at 7:51
  • true, but 95% of time there is no major issue, and for remaining 5% cases, just changing temporarily the $PATH is often the solution... I prefer brew for ease and lightweight, but macports has many more packages we will probably never see in homebrew...
    – Vincent
    Apr 16, 2011 at 9:29
  • @Vincent - the whole point of homebrew is that you can fairly easily build your own formula's so the "never see in homebrew" seems to miss the point of it entirely. MacPorts is convenient, since you don't really have to do much, effectively giving you a BSD port or Debian apt-get style installer.
    – ocodo
    Aug 30, 2011 at 0:55
  • @slojomo, look at some very complex macports "ports" with tons of dependencies like deluge, you will understand... plus the fact that homebrew has a policy of no formula overriding system components... (like mysql...)
    – Vincent
    Aug 30, 2011 at 8:27

25 Answers 25

92
votes

Homebrew

The missing package manager for OS X.

It is an amazing package manager, very light and easy to use. KIS Principle, that makes me think of archlinux. Its community is big and very active.

(see also macports which brew doesn't replace completely, I prefer installing packages with brew, but some complex ones are only on macports)

See also brew tap command which provides some missing formulas that can be useful like when you need latest php version > brew tap josegonzalez/php.

(Homebrew has a policy of not replacing system components, but hey, sometimes you have to)

4
  • Your FormulaAlt link is down. (404)
    – ottel142
    Apr 22, 2013 at 10:52
  • edited to mention brew tap which is now the built in solution to handle external "formulas".
    – Vincent
    Apr 23, 2013 at 18:17
  • Note you can also specify an "external" formula directly via URL to it's formula.rb
    – ocodo
    Dec 31, 2013 at 3:36
  • UPDATE: Homebrew is now willing to replace system components, e.g. make, curl, bash, zsh... You just need an extra step: brew link --force <package> to overwrite the system copy. Also, some non-essential duplicate packages are stored in the homebrew-dupes repo instead of the canonical one.
    – Caleb Xu
    Feb 4, 2015 at 1:17
62
votes

iTerm2 (Free)

Mentioned in comments, but it's essential, so for emphasis...

3
  • 7
    Seriously, forget OSX Terminal + Visor, iTerm2 is so much better, I'm splitting panes all day in full screen with a hotkey à la visor... There are also many other wonderful features...
    – Vincent
    Aug 30, 2011 at 7:51
  • 1
    Strangely, it hasn't had an update of the stable release since July 2011, and a beta came out in July 2012 which never got promoted. Is this project dead? Oct 12, 2012 at 23:30
  • 1
    @Yar it's still being developed. The author maintains the official repo here: github.com/gnachman/iTerm2
    – mh.
    Dec 4, 2012 at 5:21
37
votes

Ack (Free)

Great for searching text files, you'll never have to use a find/grep combination again.


Ack has two nice integration plugins for major OSX text editors:

6
  • 3
    +1 Ack is such an awesome grep replacement, if it wasn't for the fact that grep is in my muscle memory, I'd never use it at all.
    – ocodo
    Aug 30, 2011 at 23:13
  • Ack is a must have tool, makes grep developer friendly, but this one is a bit off-topic since it is not related to OSX, editing this answer to add Vim/AckMate information.
    – Vincent
    Sep 6, 2011 at 13:28
  • 1
    grin is also a good alternative.
    – gak
    Oct 25, 2012 at 21:13
  • grin is wonderful, here's the link: pypi.python.org/pypi/grin Nov 14, 2012 at 3:55
  • 2
    These days, it’s all about The Silver Searcher. Oct 25, 2013 at 21:28
33
votes

oh-my-zsh (Free)

A handful of functions, auto-complete helpers, and stuff that makes you shout…

“OH MY ZSHELL!”

Made me love shell when I was just using it when I had to... Zsh is "bash on steroids", with oh-my-zsh and all its plugins, many specifics to OSX, shell is a lot more user friendly and powerful... Oh also themes are pretty cool.


Also worth giving a look, some alternatives / complements zsh based stuff :

  • prezto Is a complete rewrite of oh-my-zsh, clean and a lot more active, now using it :)
  • zsh-users (Free) Some very nice zsh stuff (love the syntax highlighting)
  • zcm (Free) zsh configuration manager (inspired from oh-my-zsh)
4
  • 1
    zsh with oh-my-zsh really is awesome, it will even do path completion over an scp/ssh command if you've enabled public key authentication to the server you're looking at, it rocks. (awesomely-powerful completion... /v/m/s/ TAB' expands to /Volumes/MyDrive/Src)
    – ocodo
    Aug 30, 2011 at 23:17
  • +1 for prezto. I love the approach of using git submodules.
    – Acorn
    Mar 23, 2013 at 2:00
  • Also check out github.com/zsh-users/antigen
    – ocodo
    Dec 31, 2013 at 3:35
  • Prezto is much faster than oh-my-zsh. You should try it.
    – Rnhmjoj
    Sep 16, 2014 at 15:33
32
votes

lolcat (Free)

lolcat

5
  • 2
    Surely the most useful terminal tool, evah! (After cowsay and figlet that is.)
    – ocodo
    Aug 30, 2011 at 4:00
  • 9
    Clearly the reason 256-color support was addd to Lion Terminal.
    – Chris Page
    Sep 4, 2011 at 9:42
  • 2
    nice one (lol) but a bit off-topic, not really OSX related
    – Vincent
    Sep 6, 2011 at 13:26
  • Who cares ? =) It is a nice tool ! Jan 8, 2014 at 16:42
  • Most useful install ever.
    – Jan
    Sep 21, 2015 at 9:23
24
votes

Shell functions

I can't live without this.

  • One command to update them all.

    update() {
        local brew="brew update; brew upgrade;"
        local gisty="gisty pull_all; gisty sync_delete"
        local gem="gem update;"
        local pip="pip freeze --local | grep -v '^\-e' | cut -d = -f 1  | xargs pip install -U -q"
        sh -c $brew$gisty; sudo sh -c $gem$pip
    }
    

    Obviously you can add more commands according to the package managers you use. This is made by me.

  • Change directory to the current Finder directory

    cdf() {
        target=`osascript -e 'tell application "Finder" to if (count of Finder windows) > 0 then get POSIX path of (target of front Finder window as text)'`
        if [ "$target" != "" ]; then
            cd "$target"; pwd
        else
            echo 'No Finder window found' >&2
        fi
    }
    

    cdf to open the Finder directory in the terminal and open . to open in Finder the directory terminal directory.

    Source

  • Get colors in manual pages

    man() {
        env \
        LESS_TERMCAP_mb=$(printf "\e[1;31m") \
        LESS_TERMCAP_md=$(printf "\e[1;31m") \
        LESS_TERMCAP_me=$(printf "\e[0m") \
        LESS_TERMCAP_se=$(printf "\e[0m") \
        LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
        LESS_TERMCAP_ue=$(printf "\e[0m") \
        LESS_TERMCAP_us=$(printf "\e[1;32m") \
        man "$@"
    }
    

    Source

  • Use a RSA private key in git

    git(){
        trap 'rm -f /tmp/.git_ssh.$$' 0
        SSH_KEY="~/.ssh/id_rsa"
        echo "ssh -i $SSH_KEY \$@" > /tmp/.git_ssh.$$
        chmod +x /tmp/.git_ssh.$$
        export GIT_SSH=/tmp/.git_ssh.$$
        [ "$1" = "git" ] && shift
        git "$@"
    }
    

    I noticed that putting this into your .rc will slow down git. If you want to avoid this you should unpack the function and save it as a shell script in your $PATH

    Source (I modified it a bit. The original asks every time for the key path.)

  • Syntax highlighting in cat

    cat() {
        local out colored
        out=$(/bin/cat $@)
        colored=$(echo $out | pygmentize -f console -g 2>/dev/null)
        [[ -n $colored ]] && echo "$colored" || echo "$out"
    }
    

    This can be quite slow since it needs to parse the entire file before printing it. Never use this on a binary file!

    pip install Pygments to install pygments.

1
  • using RSA private key in git better with configuring SSH via ~/.ssh/config.
    – Eir Nym
    Jun 8, 2014 at 11:36
21
votes

Inconsolata-dz (Free)

This is a slight modification of the original Inconsolata. It is a fantastic monospaced font for use with Terminal.app, TextMate, MacVim and anywhere else you need one. A must have for any coder. enter image description here

3
  • 1
    Unfortunately, it doesn't look very good to me on your screenshot. Sep 6, 2011 at 13:32
  • Seems it suffered some compression artifacts - replaced it with a (hopefully) better one! Mar 4, 2013 at 14:17
  • Thank you. This is now my default font in almost every text writing application.
    – Rnhmjoj
    Jul 20, 2013 at 1:55
19
votes

TotalTerminal (Free)

Tabs, visor, hotkeys, very simple and reliable. Well maintained with frequent updates.

TotalTerminal

16
votes

MTR (Free) by BitWizard - combines ping and traceroute

Installation: brew install mtr --no-gtk

                                            Packets               Pings
 Host                                     Loss%   Snt   Last   Avg  Best  Wrst StDev
 1. 217.70.191.253                         0.0%    32    0.5   1.7   0.3  17.6   3.8
 2. p252-core4-d.paris.gandi.net           0.0%    32    0.5   1.1   0.3  17.8   3.1
 3. xe2-1-24-vcore1-dc1.balt.gandi.net     0.0%    32   97.4 105.7  96.9 187.7  22.0
 4. eqixva-google-gige.google.com         80.0%    31  100.8 100.2  99.6 100.8   0.4
 5. 209.85.252.80                          0.0%    31  100.3 108.0 100.0 210.4  24.3
 6. 209.85.243.114                         0.0%    31  111.9 112.6 111.7 118.6   1.2
 7. 64.233.174.87                          0.0%    31  119.8 112.7 111.6 119.8   1.9
    64.233.174.117
 8. 209.85.242.181                        16.1%    31  112.0 117.0 111.8 125.2   5.1
    209.85.253.185
    209.85.242.177
    209.85.253.181
 9. vx-in-f105.1e100.net                   0.0%    31  112.0 112.3 111.6 116.4   0.8

whatmask (Free) by Laffey Computer Imaging - IPv4 subnet calculator

Download OS X binary. Also online.

$ whatmask 192.168.5.6/22

------------------------------------------------
           TCP/IP NETWORK INFORMATION
------------------------------------------------
IP Entered = ..................: 192.168.5.6
CIDR = ........................: /22
Netmask = .....................: 255.255.252.0
Netmask (hex) = ...............: 0xfffffc00
Wildcard Bits = ...............: 0.0.3.255
------------------------------------------------
Network Address = .............: 192.168.4.0
Broadcast Address = ...........: 192.168.7.255
Usable IP Addresses = .........: 1,022
First Usable IP Address = .....: 192.168.4.1
Last Usable IP Address = ......: 192.168.7.254
4
  • nice, but a bit off-topic, not really OSX related :)
    – Vincent
    Sep 6, 2011 at 13:22
  • wow, that thing is amazing. thx for sharing
    – jupp0r
    Mar 29, 2012 at 3:06
  • How do you run mtr? No matter what i run even if I want to find out help or version I get unable to get raw sockets Nov 19, 2015 at 18:41
  • You can run it with sudo mtr example.com or setuid the binary with chown root:admin /usr/local/sbin/mtr && chmod +s /usr/local/sbin/mtr. Nov 27, 2015 at 15:37
16
votes

Autojump (free)

Great command line utility that stores cd commands and automatically creates an autocomplete shortcut to your most accessed directories.

Even better, if several directories have a similar name (starting with the same characters), Autojump will simply pick the one you most commonly go to. You won't have to type the whole name.

Example:

cd project1

j p will now take you straight to the full project1 path.

Now what if you create a similar folder called project2 which you also access often (but less than project1), Autojump will assign a lesser weight to project2 and take you straight to project1.

If you hit TAB after typing "pro" for instance, your shell will display project__, hinting at the fact that there are more than 1 matching directory. Another TAB hit will display the list of matching directories and allow you to select the one you mean.

Note: I've recently installed ZSH and noted some interference due to the autocomplete features. Autojump works perfectly on a vanilla Terminal.

2
  • While using zsh just try cd -[TAB] see how you get on.
    – ocodo
    Dec 31, 2013 at 3:39
  • @Slomojo That's different; jumping goes into hierarchies with out intermediate steps. Unless there's a zsh feature I'm missing that does this (very possible I'm missing something). May 8, 2015 at 14:18
15
votes

Solarized (Free)

Color scheme for Terminal.

Lion supports ANSI colors so hack-y things like SIMBL are no longer required.

For Snow Leopard and earlier, you'll need SIMBL installed to make the most of it since color support in Terminal.app is limited.

5
  • fyi, its vim version comes with janus ;)
    – Vincent
    May 7, 2011 at 10:03
  • Solarized for Lion Terminal doesn't look quite right for me -- the colors are off compared to Vim and iTerm. Anyone encountered this?
    – yjsoon
    Aug 29, 2011 at 6:41
  • 3
    @yjsoon forget Lion Terminal, use iTerm2...
    – Vincent
    Aug 30, 2011 at 7:54
  • 1
    @Vincent I liked iTerm2... until Lion Terminal came out, and could open new tabs in the same directory as the current tab, and greyed out history. Waiting for iTerm to get those.
    – yjsoon
    Sep 5, 2011 at 15:21
  • @yjsoon I would not be surprise that you can get this behavior with some oh-my-zsh plugins... or with a bit of scripting ;) omz ftw!
    – Vincent
    Sep 6, 2011 at 13:15
14
votes

MacPorts

The MacPorts Project is an open-source community initiative to design an easy-to-use system for compiling, installing, and upgrading either command-line, X11 or Aqua based open-source software on the Mac OS X operating system.

Many people will tell you don't use macport, use homebrew instead. That is mostly true, homebrew is lighter and easier to use. But macports offers way more packages, and some of them will never come to homebrew, because of their different philosophy. (I use both, for different needs)

For example, I recommend GTK in its quartz (native OSX) variant :

sudo port install gtk2 +no_x11+quartz

Then when you install a package that can benefit from it, like wireshark... You will get a native OSX UI, faster and looking much better than X11...

13
votes

DTerm (Free) by Decimus Software

Similar to Visor, but with some extra friendly features (also appears to be in active development)

12
votes

The Silver Searcher (Free)

A code-searching tool similar to ack, but faster.

Install it with brew

brew install the_silver_searcher
8
votes

Lunchy (Free)

A friendly wrapper for launchctl. Start your agents and go to lunch!

A convenient tool to manage (start/stop/restart) OSX services/daemons...

That's a ruby gem: gem install lunchy

8
votes

Bropages:

bro pages are a highly readable supplement to man pages. Bro pages show concise, common-case examples for Unix commands.

Example:

$ bro find
14 entries for find -- submit your own example with "bro add find"

# Executes a command on the files and folders matching a given pattern, in this case, output the last lines of each .foo file in the current folder and subfolders.
find . -name "*.foo" -exec tail {} \;

        bro thanks      to upvote (24)
        bro ...no       to downvote (0)

.......................................................................................................................................

# Outputs all the file names/paths that start with the name "Casey".  Searches recursively starting from my current directory (.)
# Throws out any error output by sending it to /dev/null
find . -name "Casey*" 2>/dev/null

        bro thanks 2    to upvote (16)
        bro ...no 2     to downvote (0)

.......................................................................................................................................

# Finds all files in and under the current directory that contain 'foo' in their name
find . -iname '*foo*'

        bro thanks 3    to upvote (13)
        bro ...no 3     to downvote (1)
7
votes

Janus + macvim

Janus is a basic distribution of vim plugins and tools intended to be run on top of the latest MacVIM snapshot

install macvim with homebrew brew install macvim and follow the (easy) janus instructions, and you are set with a powerfull text editor that has been pre-configured for you by brilliants minds. The learning curve of vim is scary at first sight, but once you are confortable with it, you'll never go back (or maybe to emacs...) (fyi, TextMate has been abandoned to its profit by many coders)

That might sounds strange, but I prefer using vim in iTerm2 than macvim... (vim is bundled in macvim, just use brew install macvim --override-system-vim)

5
votes

ProfontX (Free)

My favorite programming and terminal font on MacOS. (ProfontX is a corrected version of Profont which had issues with some characters)

4
  • Nice font, thanks, didn't knew that one, will give it a try, even if I guess I'll finally fallback to that good old Monaco (which renders great in iTerm2)
    – Vincent
    Aug 30, 2011 at 10:29
  • Monaco won, better readability for my eyes :), would love to switch to modern Menlo, but its special UTF-8 characters like ✭ are too small for shell pleasure.
    – Vincent
    Sep 6, 2011 at 13:38
  • definitely a matter of taste ;), there's something about monaco i just can't stand, it's just too crispy to my taste I guess
    – apouche
    Sep 6, 2011 at 14:05
  • 1
    oh yeah, definitely a personal choice. Dunno if there is not already one, but a community wiki exclusively about fixed-size dev fonts for OSX would be nice... ;)
    – Vincent
    Sep 6, 2011 at 17:26
4
votes

Boxen - Automated Mac OS configuration and build, install/update software. It helps saving a lot of time when you want exactly the same setup, (software, version) in the development team and also allow each individual to install other tools to increase productivity.

3
votes

Visor

is an interesting utility. It describes itself as:

a system-wide terminal on a hot-key

Quite cool. It drops down a terminal on the press of a key-combination.

EDIT:

Visor has been renamed to TotalTerminal... (see other answer, this could/should be deleted)

1
  • 4
    fyi, I switched from Terminal to iTerm2, which has a native visor like feature, and much much more like splitpanes! :)
    – Vincent
    May 7, 2011 at 10:04
3
votes

bash-it (Free)

An alternative to oh-my-zsh (see above). A really useful collection of scripts, aliases and functions for bash. Also provides a nice plugin system for adding your own additions.

3
votes

Go2Shell (Free)

Not a terminal utility, but a utility for using Terminal. It puts a button in the Finder toolbar and when pressed it creates a new Terminal window cd'ed to that directory.

edit: The developers are saying that the version of the app available directly from them has more features than the version on the App Store. I've updated the link to go to their page, but the App Store version is still available here.

4
  • Nowadays does not work on Yosemite.
    – jherran
    Nov 9, 2014 at 8:41
  • @jherran I haven't tried it myself, but the developers claim it works on Yosemite. If it doesn't for you try contacting them.
    – ThomasW
    Dec 4, 2014 at 12:04
  • I did. And said the same to me, they are working on it, but from now, does not work on Yosemite.
    – jherran
    Dec 4, 2014 at 12:07
  • They released version 2.2 on their website that they claim is Yosemite compatible.
    – ThomasW
    Jan 30, 2015 at 7:31
2
votes

Bwana (Free)

Not technically a terminal command but very handy for quick manpage lookups by allowing url of: "man:ls" to show html page of the manpage in your browser.

1
vote

Jodies.de ipcalc

 🍺  /usr/local/Cellar/ipcalc/0.41: 4 files, 40K, built in 2 seconds
 bash-3.2$ ipcalc 10.20.30.40/8
 Address:   10.20.30.40          00001010. 00010100.00011110.00101000
 Netmask:   255.0.0.0 = 8        11111111. 00000000.00000000.00000000
 Wildcard:  0.255.255.255        00000000. 11111111.11111111.11111111
 =>
 Network:   10.0.0.0/8           00001010. 00000000.00000000.00000000
 HostMin:   10.0.0.1             00001010. 00000000.00000000.00000001
 HostMax:   10.255.255.254       00001010. 11111111.11111111.11111110
 Broadcast: 10.255.255.255       00001010. 11111111.11111111.11111111
 Hosts/Net: 16777214              Class A, Private Internet

It is also available in HomeBrew:

 bash-3.2$ brew install ipcalc
 ==> Downloading http://jodies.de/ipcalc-archive/ipcalc-0.41.tar.gz
0
votes

I like Color Maven

alias maven="command mvn"
color_maven() {
  maven $* | sed -e "s/\(\[INFO\]\ \-.*\)/[36;01m\1[m/g" \
               -e "s/\(\[INFO\]\ >>> .*\)/[32;01m\1[m/g" \
               -e "s/\(\[INFO\]\ <<< .*\)/[32;01m\1[m/g" \
               -e "s/\(\[INFO\]\ Building .*\)/[36;01m\1[m/g" \
               -e "s/\(\[INFO\]\ \[.*\)/01m\1[m/g" \
               -e "s/\(\[INFO\]\ BUILD SUCCESS\)/[01;32m\1[m/g" \
               -e "s/\(\[INFO\]\ BUILD FAILURE\)/[01;31m\1[m/g" \
               -e "s/\(\[WARNING\].*\)/[01;33m\1[m/g" \
               -e "s/\(WARN.*\)/[01;33m\1[m/g" \
               -e "s/\(DEBUG.*\)/[01;33m\1[m/g" \
               -e "s/\(\[ERROR\].*\)/[01;31m\1[m/g" \
               -e "s/Tests run: \([^,]*\), Failures: \([^,]*\), Errors: \([^,]*\), Skipped: \([^,]*\)/[32mTests run: \1[m, Failures: [01;31m\2[m, Errors: [01;31m\3[m, Skipped: [01;33m\4[m/g"
}
alias mvn=color_maven

Color LS

alias ls='ls -FG'
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
-or-
echo export CLICOLOR >> ~/.bashrc
echo export CLICOLOR >> ~/.bash_profile

Not the answer you're looking for? Browse other questions tagged .