LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 06-06-2004, 11:45 AM   #1
akudewan
Member
 
Registered: Apr 2004
Location: India
Distribution: Ubuntu
Posts: 364

Rep: Reputation: 30
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??
 
Old 06-06-2004, 11:57 AM   #2
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,282

Rep: Reputation: 66
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
 
Old 06-06-2004, 12:30 PM   #3
akudewan
Member
 
Registered: Apr 2004
Location: India
Distribution: Ubuntu
Posts: 364

Original Poster
Rep: Reputation: 30
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.

Thanks.
 
Old 06-06-2004, 12:37 PM   #4
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,282

Rep: Reputation: 66
ls="ls --color" should do your wish, why add tty ?
 
Old 06-07-2004, 07:37 AM   #5
akudewan
Member
 
Registered: Apr 2004
Location: India
Distribution: Ubuntu
Posts: 364

Original Poster
Rep: Reputation: 30
er...no idea actually!! I just read it on some forum 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

Last edited by akudewan; 06-07-2004 at 07:39 AM.
 
Old 06-07-2004, 10:22 AM   #6
bonecrusher
Member
 
Registered: Mar 2004
Location: St. Louis, MO
Distribution: Slackware-current, Ubuntu Server, Gentoo
Posts: 207

Rep: Reputation: 30
Quote:
Originally posted by akudewan
er...no idea actually!! I just read it on some forum 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
 
Old 06-07-2004, 12:17 PM   #7
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,282

Rep: Reputation: 66
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).
 
Old 06-07-2004, 01:30 PM   #8
plan9
Member
 
Registered: May 2004
Location: USA
Distribution: Slackware-Current
Posts: 74

Rep: Reputation: 15
FYI

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

9
 
Old 06-07-2004, 03:41 PM   #9
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: West Sussex, England
Distribution: Gentoo
Posts: 1,457

Rep: Reputation: 45
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?
 
Old 06-07-2004, 04:16 PM   #10
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,282

Rep: Reputation: 66
Here is the content of my ~/.bash_profile
Code:
if [ -f ~/.bashrc ]; then
    source ~/.bashrc
fi
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Editing /etc/DIR_COLORS does not change colours in terminal ethics Linux - General 6 02-27-2014 01:56 AM
.bashrc and console colours edM Slackware 3 11-01-2005 02:52 PM
Questions about su, su -, shells and terminal colours Nylex Linux - General 4 08-13-2005 02:59 AM
What do the colours mean in the terminal? alaskazimm Mandriva 2 07-04-2004 07:34 AM
How do I get colours in terminal (aterm)? mr-tiddles Linux - General 5 10-23-2003 10:23 AM


All times are GMT -5. The time now is 04:25 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration