nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Add Color To MAC OSX Bash Prompt

This is a discussion on Add Color To MAC OSX Bash Prompt within the Getting started tutorials forums, part of the Linux Getting Started category; Hello, I use a Mac Book Pro for my personal laptop. When using the bash shell, I noticed that when ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Getting started tutorials

Linux answers from nixCraft.


Getting started tutorials So much to read, so little time! If that is your problem, we have solution. Read our FAQ and tutorials to help you cut through the clutter of information overload. Only members of "contributors" group can post new tutorials. Other members can just reply to thread.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 24-10-2009, 10:07 PM
jaysunn's Avatar
Powered By Linux
User
 
Join Date: Apr 2009
Location: 41.332032,-73.089775
OS: RHEL - OSX
Scripting language: BASH - Learning Ruby
Posts: 600
Thanks: 61
Thanked 78 Times in 70 Posts
Rep Power: 10
jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold
Default Add Color To MAC OSX Bash Prompt

Hello,

I use a Mac Book Pro for my personal laptop. When using the bash shell, I noticed that when performing a ls on a directory all the file listings were in the same color. However when I am on Debian or Red Hat these listings looked colorful.

I searched this topic and I was able to come up with this cool hack.

Edit your .bash_profile file in your home directory with you favorite editor. Add the following to the file. Log out and have a look. Pretty cool when you run a list.

Code:
laptop:~ jasonralph$vi ~/.bash_profile
Here is the edited file.

Code:
laptop:~ jasonralph$ cat .bash_profile
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
laptop:~ jasonralph$
So now you can logout and run a colorful listing.

Before editing:



After Editing.



Have fun,

Jaysunn
__________________
Have a look at what I have been working on
http://www.shellasaurus.com

Last edited by jaysunn; 24-10-2009 at 10:12 PM.
Reply With Quote
  #2 (permalink)  
Old 25-10-2009, 10:13 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Under BSD I use something as follows. Since OS X mostly use BSD cli tools, it may also work.
Code:
alias ls='ls -G'
ls
\ls
I've old generation Mac book, and I've got Ubuntu installed on it.
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #3 (permalink)  
Old 16-12-2009, 03:32 PM
jaysunn's Avatar
Powered By Linux
User
 
Join Date: Apr 2009
Location: 41.332032,-73.089775
OS: RHEL - OSX
Scripting language: BASH - Learning Ruby
Posts: 600
Thanks: 61
Thanked 78 Times in 70 Posts
Rep Power: 10
jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold
Default

Another great link in regards to this:

Mac OS X Vim Text Editor Set Color

Jaysunn
__________________
Have a look at what I have been working on
http://www.shellasaurus.com
Reply With Quote
  #4 (permalink)  
Old 16-12-2009, 04:17 PM
raj's Avatar
raj raj is offline
Senior Member
User
 
Join Date: Jun 2005
Location: Hyderabad
OS: Fedora, Debian Linux
Posts: 307
Thanks: 42
Thanked 8 Times in 8 Posts
Rep Power: 6
raj will become famous soon enough raj will become famous soon enough
Default

oh yah vi shows colours now
__________________
Raj
Linux rulz.
I have never turned back in my life ; I shall not do so today.. haha
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Bash ps1 prompt chinalinix Shell scripting 2 18-07-2009 12:21 AM
set timeout for ssh prompt vikas027 Shell scripting 0 23-04-2008 12:06 AM
script to prompt for password for AIX shipon_97 Shell scripting 0 15-04-2008 04:45 PM
How to make bash prompt permanent? vaibhav.kanchan Getting started tutorials 1 18-07-2007 11:46 PM
Graph COLOR MRTG MAN Linux software 2 21-03-2005 11:57 AM


All times are GMT +5.5. The time now is 07:36 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38