Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'What about bash?' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
What about bash?
Authored by: adriaant on Oct 30, '03 12:53:22AM

Sigh, it's about time submitted osxhints are better edited. Rob, you need to hire people, I guess.

Anyway, this hint is so stale and is more a Jaguar tip and should have been updated so that it works in bash, which is the default shell. In bash and while using Terminal.app, all you need is edit (create if there isn't one) a .bash_profile file in your home dir (text file of course, and use vi or bbedit for it, not rich text editors) and add:

LS_COLORS='no=00;32:fi=00:di=00;34:ln=01;36:pi=04;33:so=01;35:bd=33;04:cd=33;04: or=31;01:ex=00;32:*.rtf=00;33:*.txt=00;33:*.html=00;33:*.doc=00;33:*.pdf=00;33: *.ps=00;33:*.sit=00;31:*.hqx=00;31:*.bin=00;31:*.tar=00;31:*.tgz=00;31:*.arj=00;31: *.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.deb=00;31: *.dmg=00;36:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.ppm=00;35:*.tga=00;35: *.xbm=00;35:*.xpm=00;35:*.tif=00;35:*.mpg=00;37:*.avi=00;37:*.gl=00;37:*.dl=00;37: *.mov=00;37:*.mp3=00;35:'
export LS_COLORS;

Of course, the LS_COLORS definition is mine, and YMMV. Use dircolors to change values (see man dircolors).

[robg adds: For better readability, I have wrapped the LS_COLORS command above by inserting a line break -- remove the line breaks and enter it as one long line with no additional spaces.]

[ Reply to This | # ]
What about bash?
Authored by: fniessen on Oct 30, '03 03:24:33AM
Shouldn't this be
LSCOLORS=...
instead of
LS_COLORS=...
in the bash?
BTW I prefer to set enviroment variables in the .bash_profile file.

[ Reply to This | # ]
What about bash?
Authored by: vondrix on Oct 30, '03 06:31:23AM

There is no man dircolors. I think you are using GNU ls installed by fink, instead of the standard ls.



[ Reply to This | # ]
What about bash?
Authored by: robg on Oct 31, '03 08:08:12AM

[sarcasm]
Right, and I'll hire all those folks with the boatloads of money I'm making off the site.
[/sarcasm]

Sorry, for now it's up to the community of commenters. I test the hints, edit the hints, and put them online. This one worked and seemed interesting, so up it went.

Speaking of editing, I have edited your comment to break that really really long line into several lines -- makes for easier reading when people browse the site.

-rob.



[ Reply to This | # ]
What about bash?
Authored by: ghoppe on Nov 12, '03 05:55:39PM
Pretty arrogant of you to admonish Rob for not editing hints, and then submit a hint that will not work in either Jaguar or Panther out-of-the-box installs. This hint will only work if you have installed GNU file utilities (fileutils). You can do that through fink if you wish. (see Fink fileutils page.)

[ Reply to This | # ]