Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
colored console
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
vers_iq
Apprentice
Apprentice


Joined: 18 May 2002
Posts: 264

PostPosted: Fri May 24, 2002 4:26 pm    Post subject: Reply with quote

at the buttom of /etc/profile

if [ -f /etc/colorls.sh ]; then
. /etc/colorls.sh
fi

create /etc/colorls.sh (whatever name u want and chmod +x it) and in /etc/colorls.sh

COLORS=/etc/DIR_COLORS
eval `dircolors --sh /etc/DIR_COLORS`
[ -f "$HOME/.dircolors" ] && eval `dircolors --sh $HOME/.dircolors` && COLORS=$HOME/.dircolors
[ -f "$HOME/.dir_colors" ] && eval `dircolors --sh $HOME/.dir_colors` && COLORS=$HOME/.dir_colors

if echo $SHELL |grep bash 2>&1 >/dev/null; then
if ! egrep -qi "^COLOR.*none" $COLORS &>/dev/null; then
alias ll='ls -l --color=tty'
alias l.='ls -d .[a-zA-Z]* --color=tty'
alias ls='ls -a --color=tty'
else
alias ll='ls -l'
alias l.='ls -d .[a-zA-Z]*'
fi
fi

or whatever more options u want, and create ~/.dir_colors

COLOR tty

OPTIONS -F

TERM linux
TERM console
TERM con132x25
TERM con132x30
TERM con132x43
TERM con132x60
TERM con80x25
TERM con80x28
TERM con80x30
TERM con80x43
TERM con80x50
TERM con80x60
TERM cons25
TERM xterm
TERM rxvt
TERM xterm-color
TERM color-xterm
TERM vt100
TERM dtterm
TERM color_xterm

EIGHTBIT 1

# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
NORMAL 00 # global default, although everything should be something.
FILE 00 # normal file
DIR 34 # directory
LINK 36 # symbolic link
FIFO 33 # pipe
SOCK 35 # socket
BLK 01;33 # block device driver
CHR 01;33 # character device driver
ORPHAN 04;05;37;41 # orphaned syminks
MISSING 04;05;37;41 # ... and the files they point to

# This is for files with execute permission:
EXEC 32

# executables (bright green)
.cmd 32
.exe 32
.com 32
.btm 32
.bat 32
.sh 32
.csh 32

# archives or compressed (bright red)
.tar 01;31
.tgz 01;31
.arj 01;31
.taz 01;31
.lzh 01;31
.zip 01;31
.z 01;31
.Z 01;31
.gz 01;31
.bz2 01;31
.tbz2 01;31
.bz 01;31
.tz 01;31
.rpm 01;31
.cpio 01;31
# image and media formats
.jpg 01;35
.gif 01;35
.bmp 01;35
.xbm 01;35
.xpm 01;35
.png 01;35
.tif 01;35
.mpeg 01;35
.avi 01;35
Back to top
View user's profile Send private message
Guest






PostPosted: Tue May 28, 2002 6:44 am    Post subject: quick question: how to make 'ls' always show colors in bash? Reply with quote

how do i make ls show colors always in bash. like ls --color
Back to top
proxy
Apprentice
Apprentice


Joined: 20 Apr 2002
Posts: 260
Location: Chantilly, VA

PostPosted: Tue May 28, 2002 6:45 am    Post subject: Reply with quote

put the aliases in a file called ".bashrc" in your home directory (you can find examples in your .bash_profile (this is only run on interactive logins).

Personally, i think the aliases should be simply only in the .bashrc and have the .bash_profile execute that on interactive logins, that way you are always covered :)
Back to top
View user's profile Send private message
ElCondor
Guru
Guru


Joined: 10 Apr 2002
Posts: 520
Location: Vienna, Austria, Europe

PostPosted: Tue May 28, 2002 8:22 am    Post subject: Reply with quote

take a peek at https://forums.gentoo.org/viewtopic.php?t=866

* ElCondor pasa *
_________________
Here I am the victim of my own choices and I'm just starting!
Back to top
View user's profile Send private message
BackSeat
Apprentice
Apprentice


Joined: 12 Apr 2002
Posts: 242
Location: Reading, UK

PostPosted: Tue May 28, 2002 8:32 am    Post subject: Reply with quote

Should really be in ~/.bash_login

However, whichever file you put it in, put this:
Code:
alias ls='ls --color=auto'
The '=auto' part will make colours appear on a device capable of showing them, but will not output the colour escape sequences at other times (eg, if you pipe the output of ls to sort).

BS
Back to top
View user's profile Send private message
Guest






PostPosted: Tue May 28, 2002 10:23 am    Post subject: Reply with quote

ty. forgot about aliases. :)
Back to top
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum