View previous topic :: View next topic |
Author |
Message |
Joffer Guru
Joined: 10 Sep 2002 Posts: 585 Location: Arendal, Norway
|
Posted: Wed Apr 05, 2006 7:20 pm Post subject: [solved] no ls color output in terminal or console :( |
|
|
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 |
|
|
erik258 Advocate
Joined: 12 Apr 2005 Posts: 2650 Location: Twin Cities, Minnesota, USA
|
Posted: Wed Apr 05, 2006 7:39 pm Post subject: |
|
|
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 |
|
|
niskel Guru
Joined: 17 Nov 2004 Posts: 457 Location: Fredericton, NB, Canada
|
Posted: Wed Apr 05, 2006 7:43 pm Post subject: |
|
|
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 |
|
|
bork_bigjoe n00b
Joined: 28 Mar 2005 Posts: 57 Location: Caltech
|
Posted: Wed Apr 05, 2006 7:46 pm Post subject: |
|
|
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 |
|
|
Joffer Guru
Joined: 10 Sep 2002 Posts: 585 Location: Arendal, Norway
|
Posted: Wed Apr 05, 2006 8:54 pm Post subject: |
|
|
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 |
|
|
nobody13 Apprentice
Joined: 21 Jan 2006 Posts: 190
|
Posted: Fri Apr 28, 2006 6:35 pm Post subject: |
|
|
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 |
|
|
|