LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   No .bashrc, I need colours in the terminal!! (https://www.linuxquestions.org/questions/slackware-14/no-bashrc-i-need-colours-in-the-terminal-190344/)

akudewan 06-06-2004 11:45 AM

No .bashrc, I need colours in the terminal!!
 
Hi,
I'm using slack 9.1. I usually use gnome 2.4 as my window manager. In the gnome-terminal, when I do "ls", the dirs and files are not color coded. But I can see the colors in the other terminals (CTRL+ALT+F1 and all).

So I did a little research and found that I have to add the line alias ls='ls --color=tty' in the .bashrc file in my home directory. But there is no such file. Further searching revealed that there IS no .bashrc in slack. So I had to edit the /etc/profile file instead. I added the line there, but it makes no difference. Now I'm stuck!!

btw.."ls --color=always" works, but I want the colors to come by default. Can anyone help??

keefaz 06-06-2004 11:57 AM

if your ~/.bashrc does not exist than create it. But in slackware ls color is the default, I guess you would call your gnome-terminal with the good switch,
for kde Konsole and xterm the switch is : -ls
try gnome-terminal -ls and see if it works

akudewan 06-06-2004 12:30 PM

Thanks keefaz. I just created a .bashrc file in my home directory with one line in it: alias ls='ls --color=tty' and it started working. :D

Thanks.

keefaz 06-06-2004 12:37 PM

ls="ls --color" should do your wish, why add tty ?

akudewan 06-07-2004 07:37 AM

er...no idea actually!! I just read it on some forum :p Whats imp for me is that it works. But given it a thought, probably "tty" coz then it uses the default settings of all the terminals, and slackware by default HAS colors in the terminal (in the text-mode runlevel that is)

If anyone knows, post it here

bonecrusher 06-07-2004 10:22 AM

Quote:

Originally posted by akudewan
er...no idea actually!! I just read it on some forum :p Whats imp for me is that it works. But given it a thought, probably "tty" coz then it uses the default settings of all the terminals, and slackware by default HAS colors in the terminal (in the text-mode runlevel that is)

If anyone knows, post it here

You could even add your alias's to your /etc/profile (if using bash/etc -Bourne shells) so it will be system wide-ie: effect all users

I have the strange condition of bash not recognizing my .bashrc but it does recognize the .bash_login. I think this is the way it was compiled...(Slack 9.1 default?) hmmm

Oh well-

bc

keefaz 06-07-2004 12:17 PM

as I said it is just a switch to add to start the gnome-terminal.

Exemple : from fluxbox (in X so...), I start xterm in a terminal with no option...when I 'ls' in the terminal, it has no colors...BUT when I start xterm like : 'xterm -ls' and then I 'ls', it has color, the same with the Konsole terminal gui from kde (-ls).

plan9 06-07-2004 01:30 PM

FYI

There are some nice bashrc files (as well as others) here:
http://dotfiles.com/

9

oneandoneis2 06-07-2004 03:41 PM

When I was trying to get aliases etc sorted out in bash, .bashrc didn't work - I had to put it in .bash_profile instead. An oddity of Slack 9.1?

keefaz 06-07-2004 04:16 PM

Here is the content of my ~/.bash_profile
Code:

if [ -f ~/.bashrc ]; then
    source ~/.bashrc
fi



All times are GMT -5. The time now is 11:33 PM.