View Full Version : " ls " no color

30th July 2008, 12:10 AM

I'm currently running FC8. When I installed FC8 C-Shell was not an option, so I installed it. C-Shell works, however, when I "ls" all of the files, directories, and executables are all black (no color). If I "ls --color" the files are colored. I know I can make this an alias in my .crsh file, but I should not have to do this. Also, my programs are not color coded when I use vi editor, I believe this is a related problem.

What do I need to do???

Thanks for any help


30th July 2008, 03:13 AM
Why should you not have to set an alias? Not everyone likes color in ls, you know. ;)

30th July 2008, 03:22 AM
Why should you not have to that? The default bash shell also does it by alias, if not in the user's $HOME/.bash_profile or .bashrc, in an /etc/system wide profile.
So, it's probably the simplest way.

As for the vim color syntax, try creating a $HOME/.vimrc file and add the line
syntax on

If you only have vim-minimal installed, that might not work.
If that doesn't work, then do rpm -q vim-enhanced
If it's not installed, install it, and that should fix the problem, probably without the need for the $HOME/.vimrc.

30th July 2008, 04:11 AM
The files should be color coded by default, at least this was how it was for FC 3-7. If I'm in bash, for example, the files are color coded. Just not in csh, which I want to run.

Setting the alias in .crsh, is not the right way to due this RupertPupkin.

I will try what you suggested scottro, thanks

30th July 2008, 04:20 AM
Wrong file, I mean .cshrc not .crsh

30th July 2008, 04:44 AM
I think there's some misunderstanding here. I'm saying the same thing that RupertPunkin is saying.
I think you might have missed my point that the reason it's the way it is in bash is because there IS an alias set. It's set system wide and annoys many people. :)
(Actually, looking at a CentOS machine, I see that there is an /etc/profile.d/colorls.sh and colorls.csh. (It also seems as if CentOS installs csh by default.)

If you have that, then I'm surprised that you don't have colors with ls. (Or maybe it's in there as rpmnew or something.)

Did you install csh as an rpm or did you build it from source. If the latter, that's probably your answer. It seems, judging from CentOS, that if it's installed via yum, it will probably create that systemwide /etc/profile.d/colorls.csh. Otherwise, you'll have to put it in .cshrc.

There's nothing wrong with putting it in there, I'm not sure why it annoys you that you might have to do it that way.

So, the very short answer is that, at least in CentOS, csh is installed by default and there is an /etc/profile.d/colorls.csh which will, by default alias ls to doing ls with colors. If you installed from source, then there will be no such file, which is why bash will do it by default and csh doesn't. In such a case, you can see if it's available via yum, and if so, see if it creates that colorls.csh.

If you did install it from yum and don't have that file, then I suppose you could either create it, or add the alias to your .cshrc file, which seems (to me) to be by far the easiest way to do it.

I guess it depends upon how interested you are in figuring out why it's not defaulting to doing ls with color in csh. There are also other files in /etc that make any installed shell (that is, installed by the system as opposed to being built from source and installed by the user) look through that /etc/profile.d directory.

30th July 2008, 01:39 PM
Thanks for the explanation scottro.

I just wanted to figure out what the problem is, other people use the same computer an have the same problem, therefore, I would like to fix it for the whole group and have every one add it to their .cshrc file.

I did install csh with yum, and the colorls.csh file is there, maybe it is not running on startup. I was also hoping that by figuring out this problem, vi would be color coded (which I really do like when programing).