The Computer Oracle

color coding mac terminal

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Hypnotic Puzzle4

--

Chapters
00:00 Color Coding Mac Terminal
00:19 Answer 1 Score 5
00:35 Answer 2 Score 14
00:57 Accepted Answer Score 4
01:34 Thank you

--

Full question
https://superuser.com/questions/232583/c...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#macos #terminal #colors

#avk47



ANSWER 1

Score 14


Add, these lines to the end of your ~/.bash_profile

alias ls='ls -G'
export CLICOLOR=1
export LSCOLORS=Gxfxcxdxbxegedabagacad

As you can see, customizing them is a bit of a pain, but there's a website that helps with that... http://geoff.greer.fm/lscolors/

Now when you open the Terminal it will have colors in ls




ANSWER 2

Score 5


Use the -G switch to ls on Mac:

ls -G

If you'd like the standard ls to always be colored, add this to your ~/.bash_profile:

alias ls='ls -G'



ACCEPTED ANSWER

Score 4


You can change your shell colors in Terminal's preferences.

alt text


With these settings, you get these colors (not usually using colored ls, so I don't care):

alt text


I don't understand what the issue is here. Colored command output is active by default. The only thing you can/need to do yourself is give normal and bold text different default colors, and actually use the colored variants (e.g. ls -G) of your commands.

For vim: :syntax on in vim. Or append syntax on to .vimrc.