View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 5 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Sun Sep 16, 2007 12:28 am 
Offline
Joined: Tue Jul 12, 2005 8:01 am
Posts: 670
Location: Salem, MA
When I was root in R5D1 and previous bash had color coding. Now when I log in via ssh and then su to root there is no coloring. Is there an easy way to make this back to the way it was, or will I have to setup config files from scratch? Was this a conscious decision to make this change, or is it an artifact of not logging in as root?

Thanks.

_________________
LinHES 8.3, 1 BE, 3 FE


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 16, 2007 7:04 am 
Offline
Joined: Fri Jan 12, 2007 9:55 pm
Posts: 47
Location: Brisbane, Queensland
I think what you need to do is check the alias command in the appropriate ~/.bashrc files.

It seems on my system, that .bashrc just reads /etc/profile which has the lovely alias
alias ls="ls --color=auto"

(as well as similar aliases for la and ll)

_________________
My Ziki


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 16, 2007 10:27 am 
Offline
Joined: Tue Jan 18, 2005 2:07 am
Posts: 1532
Location: California
/etc/profile in r5f27 does have the appropriate alias to get colors, but...

When you login as a user, root or otherwise, /etc/profile is processed. When you do an "su", /etc/profile is not processed, so you don't get the aliases established. So the difference in behavior between R5D1 and R5F27 is that with R5D1 you did a direct login to root; with R5F27 you get this by "su".

A way to solve this is to su to root and add the following to the end of /.bashrc
Code:
alias which="type -path"
alias where="type -all"
alias ll="ls -l --color=auto"
alias rm="rm -i"
alias mv="mv -i"
alias cp="cp -i"
alias la="ls -la --color=auto"
alias ls="ls --color=auto"


Your current ".bashrc" file is probably empty or may not exist. Finally, I found that the coloring in R5F27 for directories that have open permissions to be very distracting -- it uses green inverse video. I changed this to something I found more acceptable. If you don't like the use of inverse-video-green for these types of directories, you can solve this by creating the file /dir_colors.mine with the content shown at the end of this post. You then need to add the following line to the end of both /etc/profiles and /.bashrc
Code:
eval `dircolors -b /dir_colors.mine`


Marc

Be sure to create the file "/dir_colors.mine" with the following content and execute the command "chmod a+r /dir_colors.mine":
Code:
# Configuration file for dircolors, a utility to help you set the
# LS_COLORS environment variable used by GNU ls with the --color option.
# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
# slackware version of dircolors) are recognized but ignored.
# Below, there should be one TERM entry for each termtype that is colorizable
TERM linux
TERM linux-c
TERM mach-color
TERM console
TERM con132x25
TERM con132x30
TERM con132x43
TERM con132x60
TERM con80x25
TERM con80x28
TERM con80x30
TERM con80x43
TERM con80x50
TERM con80x60
TERM cygwin
TERM dtterm
TERM mlterm
TERM putty
TERM xterm
TERM xterm-color
TERM xterm-debian
TERM rxvt
TERM rxvt-unicode
TERM screen
TERM screen-bce
TERM screen-w
TERM vt100
TERM Eterm
# Below are the color init strings for the basic file types. A color init
# string consists of one or more of the following numeric codes:
# Attribute codes:
# 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 01;34 # directory
LINK 01;36 # symbolic link. (If you set this to 'target' instead of a
 # numerical value, the color is as for the file pointed to.)
FIFO 40;33 # pipe
SOCK 01;35 # socket
DOOR 01;35 # door
BLK 40;33;01 # block device driver
CHR 40;33;01 # character device driver
ORPHAN 40;31;01 # symlink to nonexistent file
SETUID 37;41 # file that is setuid (u+s)
SETGID 30;43 # file that is setgid (g+s)
STICKY_OTHER_WRITABLE 01;34 # dir that is sticky and other-writable (+t,o+w)
OTHER_WRITABLE 01;34 # dir that is other-writable (o+w) and not sticky
STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable
# This is for files with execute permission:
EXEC 01;32
# List any file extensions like '.gz' or '.tar' that you would like ls
# to colorize below. Put the extension, a space, and the color init string.
# (and any comments you want to add after a '#')
# If you use DOS-style suffixes, you may want to uncomment the following:
#.cmd 01;32 # executables (bright green)
#.exe 01;32
#.com 01;32
#.btm 01;32
#.bat 01;32
.tar 01;31 # archives or compressed (bright red)
.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
.deb 01;31
.rpm 01;31
.jar 01;31
# image formats
.jpg 01;35
.jpeg 01;35
.gif 01;35
.bmp 01;35
.pbm 01;35
.pgm 01;35
.ppm 01;35
.tga 01;35
.xbm 01;35
.xpm 01;35
.tif 01;35
.tiff 01;35
.png 01;35
.mov 01;35
.mpg 01;35
.mpeg 01;35
.avi 01;35
.fli 01;35
.gl 01;35
.dl 01;35
.xcf 01;35
.xwd 01;35
# audio formats
.flac 01;35
.mp3 01;35
.mpc 01;35
.ogg 01;35
.wav 01;35


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 16, 2007 11:37 am 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
marc.aronson wrote:
When you do an "su", /etc/profile is not processed, ...

This is why I almost always recommend using "su -" which causes it to act like a login shell and thus source the dot files... it's a simple thing to remember and avoids a lot of problems.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 16, 2007 1:06 pm 
Offline
Joined: Tue Jul 12, 2005 8:01 am
Posts: 670
Location: Salem, MA
Cool trick tjc, thanks!

_________________
LinHES 8.3, 1 BE, 3 FE


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 12 guests


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 post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu