Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] no ls color output in terminal or console :(
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Joffer
Guru
Guru


Joined: 10 Sep 2002
Posts: 585
Location: Arendal, Norway

PostPosted: Wed Apr 05, 2006 7:20 pm    Post subject: [solved] no ls color output in terminal or console :( Reply with quote

Neither my console nor (gnome-)terminal displays different colors when I do 'ls'. I want color to be on always, like 'ls --color=auto'. Has it been disabled in bashrc or something? I want to enable it, and I guess there are other ways than make another alias?
_________________
As of April 2006 - Athlon64 X2 4200+ 1GB RAM - amd64-2006.0 profiled system with portage 2.1_preX, ck-sources-2.6.16, glibc-2.4-r1 (overlay w/-Bdirect&-hashvals), binutils-2.16.91.0.6 (overlay), gcc-4.1, Xorg 7


Last edited by Joffer on Wed Apr 05, 2006 8:43 pm; edited 1 time in total
Back to top
View user's profile Send private message
erik258
Advocate
Advocate


Joined: 12 Apr 2005
Posts: 2650
Location: Twin Cities, Minnesota, USA

PostPosted: Wed Apr 05, 2006 7:39 pm    Post subject: Reply with quote

from ~/.bashrc
Quote:
# colors for ls, etc.
eval `dircolors -b /etc/DIR_COLORS`
alias d="ls --color"
alias ls="ls --color=auto"
alias ll="ls --color -l"


this is the only way I have ever done it. you'll notice that the easiest way to achieve this is to copy the rc file from /etc/skel to a new user's home directory.

want it to be systemwide and break the ability to not use color? try something along the lines of (as root) replacing /bin/ls with a command that calls the old /bin/ls, with --color, and following it $1 .. $n that is all arguments to the replacement command.... an anologue of an alias i guess you could say. a poor one. odn't do that.
Back to top
View user's profile Send private message
niskel
Guru
Guru


Joined: 17 Nov 2004
Posts: 457
Location: Fredericton, NB, Canada

PostPosted: Wed Apr 05, 2006 7:43 pm    Post subject: Reply with quote

erik258 wrote:
want it to be systemwide and break the ability to not use color? try something along the lines of (as root) replacing /bin/ls with a command that calls the old /bin/ls, with --color, and following it $1 .. $n that is all arguments to the replacement command.... an anologue of an alias i guess you could say. a poor one. odn't do that.
Umm... or just add "alias ls='ls --color=auto'" to /etc/bash/bashrc...
Back to top
View user's profile Send private message
bork_bigjoe
n00b
n00b


Joined: 28 Mar 2005
Posts: 57
Location: Caltech

PostPosted: Wed Apr 05, 2006 7:46 pm    Post subject: Reply with quote

I have the following in my .bashrc (well, it's actually in a file called .bash_alias which is sourced from .bashrc, but same difference)
Code:
alias ls="ls -F -C --color=auto"
According to the ls man page, you can set default options by setting the LS_OPTIONS environmental variable. That doesn't work in the obvious way, though. You can read some about it at http://www.webservertalk.com/archive305-2004-12-657174.html. The gist is that /bin/ls doesn't actually read the environmental variable, it is just used by dircolors to set up an alias for you. Haven't looked into that myself, that's just what they said at that link.
Back to top
View user's profile Send private message
Joffer
Guru
Guru


Joined: 10 Sep 2002
Posts: 585
Location: Arendal, Norway

PostPosted: Wed Apr 05, 2006 8:54 pm    Post subject: Reply with quote

thanks guys. I thought there were some line or something that disabled the colors.. Will probably add an alias for ls like the one bork_bigjoe wrote here
_________________
As of April 2006 - Athlon64 X2 4200+ 1GB RAM - amd64-2006.0 profiled system with portage 2.1_preX, ck-sources-2.6.16, glibc-2.4-r1 (overlay w/-Bdirect&-hashvals), binutils-2.16.91.0.6 (overlay), gcc-4.1, Xorg 7
Back to top
View user's profile Send private message
nobody13
Apprentice
Apprentice


Joined: 21 Jan 2006
Posts: 190

PostPosted: Fri Apr 28, 2006 6:35 pm    Post subject: Reply with quote

niskel wrote:
erik258 wrote:
want it to be systemwide and break the ability to not use color? try something along the lines of (as root) replacing /bin/ls with a command that calls the old /bin/ls, with --color, and following it $1 .. $n that is all arguments to the replacement command.... an anologue of an alias i guess you could say. a poor one. odn't do that.
Umm... or just add "alias ls='ls --color=auto'" to /etc/bash/bashrc...




Thanks,
That cured mine it's been bothering me for about a month now.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum