LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 06-22-2003, 06:52 PM   #1
Onox
Member
 
Registered: Jun 2003
Distribution: RedHat 9
Posts: 45

Rep: Reputation: 15
How to add color to ls in Slackware gnome-terminal?


Nothing I try will work. I can type 'ls --color' and it'll work, but I want it so if I just type 'ls' it will be in color. Any help?
 
Old 06-22-2003, 06:54 PM   #2
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 58
go find the manual "BASH-prompt HOWTO"
 
Old 06-22-2003, 06:58 PM   #3
Onox
Member
 
Registered: Jun 2003
Distribution: RedHat 9
Posts: 45

Original Poster
Rep: Reputation: 15
It works if I don't start X, but when I start X then go to the terminal, it's not in color.
 
Old 06-22-2003, 07:01 PM   #4
Thetargos
Senior Member
 
Registered: Mar 2003
Location: Mexico City
Distribution: Fedora, Ubuntu & Mint
Posts: 1,679

Rep: Reputation: 45
look for the environment variable LS_COLORS. If you haven't set it, here is what it is in my computer. You could search the man page for the dircolors program.

Code:
LS_COLORS='no=00:fi=00:di=00;34:ln=00;36: pi=40;33:so=00;35:bd=40;33;01:cd=40;33;
01: or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;
32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;
31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;
31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:'
Note: had to edit it so it could fit in the normal width of the board.

Edit: I had to seperate two arguments (there shouldn't be spaces), because the display was and

Last edited by Thetargos; 06-22-2003 at 07:06 PM.
 
Old 06-22-2003, 07:23 PM   #5
Onox
Member
 
Registered: Jun 2003
Distribution: RedHat 9
Posts: 45

Original Poster
Rep: Reputation: 15
they're all there! but it just doesn't work
 
Old 06-22-2003, 08:53 PM   #6
fancypiper
Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 57
Make an alias! My .bashrc
Code:
# Red Hat 7.3 Duron 950 uilleann .bashrc for user fancy
# User specific aliases and functions

# Change bash prompt. See the article
# http://www-106.ibm.com/developerwork.../l-tip-prompt/
export PS1="\d \@ \[\e[32;1m\]\u\[\e[34;1m\]@\[\e[36;1m\]\H \[\e[34;1m\]\w\[\e[32;1m\] $ \[\e[0m\]"
# For the root account use this
# export PS1="\d \@ \[\e[31;1m\]\u\[\e[34;1m\]@\[\e[36;1m\]\H \[\e[34;1m\]\w\[\e[31;1m\] # \[\e[0m\]"

# Set paths
alias path='echo -e ${PATH//:/\\n}'

# Allow local users to use my X session
# xhost +local:

# Dialup, start fetchmail daemon and startx
alias x='/sbin/ifup ppp0;fetchmail -d 300;startx'

# Alter the ls command
alias ls='ls -ac'
alias lls='ls -lac'

# Become system administrator
alias god='su -'

# Connect/disconnect the internet by modem
alias dial='/sbin/ifup ppp0'
alias hangup='/sbin/ifdown ppp0'

# Launch links with my linux links page
alias links='links /home/fancy/bookmarks.html'

# Power down/reboot
alias off='shutdown -h now'
alias boot='shutdown -r now'

# For nano editor because I forget which one I use in which distro
alias pico='nano -w'
alias nano='nano -w'

# Script needs to be on the bottom of the file or RH updates will fsck it up
# Source global definitions
if [ -f /etc/bashrc ]; then
       	. /etc/bashrc
fi

Last edited by fancypiper; 06-22-2003 at 09:19 PM.
 
Old 06-22-2003, 08:59 PM   #7
Onox
Member
 
Registered: Jun 2003
Distribution: RedHat 9
Posts: 45

Original Poster
Rep: Reputation: 15
Okay, I never had a .bashrc file. How do I get it to read it at startup?
 
Old 06-22-2003, 09:13 PM   #8
teacup
Member
 
Registered: Mar 2003
Location: Rockford, Illinois
Distribution: Slackware Debian
Posts: 86

Rep: Reputation: 15
Slackware doesn't create one by default. Simply write one with your favorite text editor and put it in your home folder. Bash should then load it up whenever it is run.
 
Old 06-22-2003, 09:15 PM   #9
Onox
Member
 
Registered: Jun 2003
Distribution: RedHat 9
Posts: 45

Original Poster
Rep: Reputation: 15
Kay, thanks
 
Old 06-22-2003, 09:16 PM   #10
fancypiper
Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 57
If you have a .bashrc file in your user's directory, it will be read upon login.

To have it take effect immediatly after creating/saving, command

source ./.bashrc
 
Old 06-22-2003, 09:26 PM   #11
Onox
Member
 
Registered: Jun 2003
Distribution: RedHat 9
Posts: 45

Original Poster
Rep: Reputation: 15
thanks guys, I put it in aliases and it works now. ^_^
 
  


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
Terminal background color not working mijohnst Linux - Newbie 2 10-03-2005 04:11 PM
Turning off terminal color highlight penguinco Fedora 1 12-08-2004 11:25 AM
Terminal font and color berkay Linux - Newbie 10 09-23-2004 02:19 AM
Add Color cj2001 Linux - Newbie 2 03-31-2004 08:03 PM
get terminal color? cratos Programming 0 07-16-2003 03:04 PM


All times are GMT -5. The time now is 01:04 AM.

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