Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How could I enable syntax highlighting on the shell and in emacs when I use on Mac OS X to ssh into other machines? Right now if I ssh and do an "ls" for example, directories are not shown in a different color from flat files, for example, and I'd like to fix that.


share|improve this question

migrated from Apr 30 '10 at 22:33

This question came from our site for professional and enthusiast programmers.

up vote 5 down vote accepted

Do you have a .bashrc or similar on those machines that you are ssh'ing to? I believe that is what you need, with something like alias ls="ls --color=auto" or alias ls="ls -G"(depending on your ls) in each (for ls; there are lots of other options to do other colors with other terminal programs).

share|improve this answer

In OS X, you need to add alias ls="ls -G" to your ~/.bash_profile file. The file is originally hidden, so you'll need to either show hidden files in the Finder or use a program like Textmate that can open hidden files.

share|improve this answer
Any program can open hidden files. Just press Cmd-Shift-. in the file dialog. – Daniel Beck Feb 8 '11 at 11:42
Whoa, I had no idea about that. Nice tip! – Scottie Feb 9 '11 at 10:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.