LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-10-2001, 12:34 AM   #1
JapKraut
LQ Newbie
 
Registered: Aug 2001
Distribution: Debian
Posts: 13

Rep: Reputation: 0
getting permanent color for ls?


Just wondering how I can get ls to always show color without me typing the switch. I tried editing my .bashrc with --color=always and I also tried --color=yes and --color=tty Nothing seems to work.
 
Old 09-11-2001, 12:23 AM   #2
elconde
Member
 
Registered: Sep 2001
Location: Cherry Hill, NJ
Distribution: Gentoo baby!
Posts: 67

Rep: Reputation: 15
A simple alias ls 'ls --color=tty' line in the .bashrc file should work. I did that and it works fine. But then I use tcsh instead of bash (I edited .tcshrc instead of .bashrc ). I don't see how that would make any difference.

I hope that's helpful.




-Robert
 
Old 09-11-2001, 03:50 PM   #3
JapKraut
LQ Newbie
 
Registered: Aug 2001
Distribution: Debian
Posts: 13

Original Poster
Rep: Reputation: 0
thanks, but...

I appreciate the advice, but it doesn't seem to work; I'm not sure where the problem is. I tried adding

alias ls 'ls --color=tty'

as well as

alias ls='ls --color=tty'

to .bashrc; neither of these seem to make any difference.

Any other suggestions?
 
Old 09-12-2001, 09:47 AM   #4
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
What is your TERM environment set to? if its something like VT100 - a non-colour terminal then you'll never get colour nomatter what options you use! Run env | grep TERM to list it... Just a thought...

Jamie...
 
Old 09-12-2001, 10:42 AM   #5
JapKraut
LQ Newbie
 
Registered: Aug 2001
Distribution: Debian
Posts: 13

Original Poster
Rep: Reputation: 0
well...

Typing env |grep TERM
only produces:

TERM=linux

Besides that, my monitor doesn't have any difficulty displaying color with ls. I just can't fathom why the changes to my .bashrc won't take effect.
 
Old 09-12-2001, 04:10 PM   #6
elconde
Member
 
Registered: Sep 2001
Location: Cherry Hill, NJ
Distribution: Gentoo baby!
Posts: 67

Rep: Reputation: 15
Put the line alias ls='ls --color=tty' in .bash_profile instead. That worked when I tried using the bash shell.

Is .bashrc even sourced? I don't usually use bash, but I tried it and it wasn't executing anything from .bashrc.

I put an echo blah line in .bashrc and it didn't show up when I logged in. It showed up fine (and the color alias worked) when I typed source .bashrc after loggin in. It also showed up when I typed bash to run another bash shell inside the original.

The .bash_profile file is sourced for sure, though.
 
Old 09-13-2001, 02:18 AM   #7
linuxcool
LQ Addict
 
Registered: Jun 2001
Posts: 1,183

Rep: Reputation: 47
Just try alias ls='ls --color' or alias ls='ls --color=always' and see what happens.

Last edited by linuxcool; 09-13-2001 at 02:20 AM.
 
Old 09-13-2001, 09:43 AM   #8
JapKraut
LQ Newbie
 
Registered: Aug 2001
Distribution: Debian
Posts: 13

Original Poster
Rep: Reputation: 0
I just sourced .bashrc, and everything works fine! Thanks, elconde.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Color Depth, True Color, How to pacranch Amigo 2 04-09-2005 05:16 AM
[COLOR=red]ENCORE WIRELESS PCI Card 802.11b [/COLOR] enrique145 Linux - Hardware 3 07-07-2004 02:31 PM
bsetroot -gradient texture -from color -to color patpawlowski Linux - General 3 02-10-2004 01:51 PM
ls --color 'color change' ekdya Linux - General 1 10-06-2003 03:47 PM
[COLOR=seagreen]HELP-want to use Kickstart/rh7.2 on a notebook[/COLOR] verbali Linux - Newbie 1 05-13-2002 01:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration