Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How could I enable syntax highlighting on the shell and in emacs when I use Terminal.app 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.

thanks.

share|improve this question

migrated from stackoverflow.com Apr 30 '10 at 22:33

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

2 Answers 2

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
3  
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

 
discard

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.