tags:

views:

291

answers:

1

I find out that you can have the following for Grep in .bashrc

 # puts colors for all grep commands
 export GREP_OPTIONS='--color=auto'

I did not manage to get the similar command for LS_OPTIONS to work.

Is there any other way than the following to give colors for your ls -command?

alias ls='ls -Gh'
A: 

Have you verified that the version of ls you are using supports colors? Also, have you verified that the your terminal type (vt-100, etc) is being recognized correctly by bash? It would also be useful to tell us what operating system you are using, because there may be some differences between the BSD variants implementations of ls and Linux.

Elijah
@Elijah: OS X and Leopard. I use Bash 4. My ls supports colors.
Masi
Well, if it is OS X - I always used an alias just like i did for OpenBSD as well. I think that is just the way it is done. Do you have a reason for disliking aliases?
Elijah
So how do you determine with some shell code what you should use:ls -Gor ls --color
To1ne