Quantcast

Enable 'ls' Colors in Tiger

Josh's picture

Termincal Colors Image
Ever use a Linux or non-Mac UNIX machine and notice the fancy colors different file names have when using the ls command in the terminal?

Well now you can have the very same thing in Tiger's terminal :-)

To enable this, follow these steps:

1) Open Terminal. Open the menu 'Terminal > Window Settings' and select 'Color' from the drop-down menu. Make sure "Disable ANSI Color" is unchecked.

2) Move to your home directory by typing the command:
cd ~
and hit return.

3) Now we need to create or add to your .profile to make the change. Enter the command vi .profile to open the file (or create it if it does not exist) in the vi text editor.

4) Whether you had an existing .profile does not matter - in either case, add the line alias ls="ls -G" and save the file.

To save a file in vi, simply hit the escape key and type :wq and hit return. This will save and then exit from the vi text editor.

5) Type exit and hit return, then quit Terminal.

6) Open the Terminal back up, enter the command ls, and wa-lah! Colors! Weeeee!! You will now have colors just like a typical linux/UNIX set up.

Hope you enjoy this, and let me know if there is any questions!

(To disable colors, simply remove the text we added to .profile)

Apfhex's picture

Or you could just type ls

Or you could just type ls with the -G, ne? Either way, color is nice.

(btw, with that flashy image I thought at first glance the article would have something to do with adding decorations to the Terminal window! =D )

Ivan's picture

That's cool. ;)

You can further personalize your Terminal by adding a welcome message or changing the background.

Greg's picture

Ok.... I apologize. I am

Ok.... I apologize. I am currently a Windoze eXasPerated user... so if this is a stupid question just ignore it.

What the heck is "terminal" for? Why customize it? How often do you use it?

my blog: http://blog.one-waymedia.com
my work: http://www.one-waymedia.com

Josh's picture

Command line programs, etc

The terminal is for command line opperations.

Similar to DOS, only the Terminal - using UNIX as it's fuel - is much more powerful.

The Terminal is usefull for mostly power users and geeks; those of us who use specifc software, develop our own, or like to get specific system stats.

Sometimes the Terminal can speed up productivity. I can quickly rename, remove, move, copy, and sort multiple files with a simple command - where as doing so by clicking, dracking, typing, etc would take much longer. Automator is making it easy for us to do things like this without the Terminal, but sometimes it's easy for people who are used to it.

Also, Spotlight boasts the ability to search within text files and find data. But, using the Terminal, Mac OS X users have been able to do this since day one via the grep command.

Terminal also does things that other free apps don't - such as tell me how many times my battery has been charged/recharged, what the current is, etc.

I imagine each user to have different reasons they believe Terminal is usefull. I honestly barely ever use it, but it is definitely something worth having.

---------------------
Josh Stevens | Nautilus7 Design
My CB Blog

Enigma's picture

Like anything unix, there's

Like anything unix, there's always more than one way to do it.. You can achieve the same effects by putting this in there instead:

export CLICOLOR="exfxcxdxbxegedabagacad"

If you look at the ls man pages, you can see what you need to customize those colors.

dhayn's picture

cool

thanks, I was looking for a way to do the opposite, disable those colors on my web server.

that checkbox did the trick in the preferences.

gpinto's picture

Colors are nice... But what

Colors are nice... But what to they mean?

Josh's picture

File type

The different colors tell you what kind of file it is.

For example:

Blue = directory/folder (apps in 'Applications' are directories, so will show as blue too)

I believe binaries are red, symbolic links (alias) is purple. There are several colors, and I don't know what file type is associated with each color (hard to find the info on the net too),

I only really like the colors because I can easily tell what is a directory and what is not.

---------------------
Josh Stevens | Nautilus7 Design
My CB Blog

xinelo's picture

it doesn't work for me

thank you very much for suggesting how to activate the color option (which is not, by default)

one additional remark: one should check that the type of shell is "xterm-color", according to what I've read to make sure it works

however, I haven't managed to make it work in my terminal. neither creating the .profile file or using the -G option with ls :/

any idea why this happens?

thanks! xinelo

User login

Partner With Us













Latest critique

business logo