Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown   Email 



SLACKWARE TIPS ( 4 )
( Missing .bashrc in Slackware )


Terminal tweak in Slackware

You might have noticed that customizing your prompt ( see: Tweaking The_Prompt ) in Slackware seems impossible because there is no .bashrc in your /home, nor in /root

To overcome this problem you need to create 3 new files, and at the same time we will take the occasion to add a few more tweaks in order to make the use of the terminal more comfortable.

First we need a .bash_profile with the following text: ( please adapt the /home/bruno to your own username )

QUOTE
# /home/bruno/.bash_profile

# make sure .bashrc works
source ~/.bashrc 


Next we make the .bashrc with this text:

QUOTE
# /home/bruno/.bashrc

# resize text to window
shopt -s checkwinsize

# custom prompt
PS1="\[\e[36;1m\][\u:\w]$ \[\e[0m\]"

# user aliases
alias l='ls'
alias la='ls -a'
alias lal='ls -al'
alias ll='ls -l'
alias lsd='ls -d */'
# just to be sure
alias rm='rm -i'
alias mv='mv -i'
alias cp='cp -i'


You see I added a few aliases, a customized prompt ( insert your own version if you have one ) and a trick to resize the text to the terminal window.


The last file you need is a /root/.bashrc: ( a /root/.bash_profile is not needed )

QUOTE
# /root/.bashrc

# resize text to window
shopt -s checkwinsize

# custom prompt
PS1="\[\e[35;1m\][\u@\h \W]# \[\e[0m\]"

# user aliases
alias l='ls'
alias la='ls -a'
alias lal='ls -al'
alias ll='ls -l'
alias lsd='ls -d */'
alias ls='ls -F --color=auto'
# just to be sure
alias rm='rm -i'
alias mv='mv -i'
alias cp='cp -i'


In the root version of the .bashrc you see an extra alias line "alias ls='ls -F --color=auto'" . . . this gives you, as root, the same colors in the terminal as the user has by default when giving the "ls" command.


Happy Tweaking !



Bruno


-- Dec 6 2005 --


Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown   Email