View previous topic :: View next topic |
Author |
Message |
Pozican n00b
Joined: 26 Feb 2005 Posts: 56
|
Posted: Sun Apr 17, 2005 2:49 am Post subject: Just deleted my .bashrc -- Need help configing it... |
|
|
Well, I accidentily deleted the contents of my .bashrc
I remember life saying -
Life wrote: | As for the username@dir stuff, you will need to edit your users .bashrc file, or another terminal configuration file depending on which term you use to do:
echo "${USER}@${PWD}~" |
So I put Code: | echo "${USER}@${PWD}~" |
And when I open new console I get Code: | Pozican@/home/Pozican~
bash-2.05b$
|
So it echo's it, but it doesn't do what I wanted it to
I also want to put color in my console, but I have no idea how to do that... any ideas? |
|
Back to top |
|
|
inode77 Veteran
Joined: 20 Jan 2004 Posts: 1303 Location: Heart of Europe
|
Posted: Sun Apr 17, 2005 2:55 am Post subject: |
|
|
Here is mine, take from it what you like and use @ own risk: Code: |
# Test if shell is interactive
if [[ $- != *i* ]]; then
return
fi
# Environment settings
if [ -e "/etc/profile.env" ]; then
. /etc/profile.env
fi
# Variables
SUDO_PREFIX="/usr/bin/sudo"
# Alias
eval `/usr/bin/dircolors -b /etc/DIR_COLORS`
alias d="ls --color"
alias ls="ls --color=auto"
alias ll="ls --color -lh"
alias la="ls --color -lha"
alias las="ls --color -lhaS"
alias lls="ls --color -lhS"
alias cp="cp -g"
alias du="du -sh"
alias df="df -h"
alias lsw="ls | /bin/wc -l"
alias netstat="netstat -antup"
alias mplayernsv="mplayer -cache 512 -playlist"
alias mplayernsvfreq3="mplayer -cache 512 -playlist ~/music/playlists/shoutcast/frequence3-ogg.m3u"
alias mplayermovie="mplayer -stop-xscreensaver"
# Settings
set -o noclobber
# Default umask
umask 022
# PS1 and sudo handling and some ugly path extension
if [ "$EUID" = 0 ] || [ "`/bin/whoami`" = 'root' ]; then
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}"
unset SUDO_PREFIX
else
PATH="/usr/local/bin:/usr/bin:/bin:${PATH}"
# Some ugly path expansion
alias ifconfig="/sbin/ifconfig"
alias route="/sbin/route"
alias arp="/sbin/arp"
alias iwconfig="/usr/sbin/iwconfig"
fi
export PATH
unset ROOTPATH
# Enables linewrapping at end of line
shopt -s checkwinsize
# Terminal title handling
case $TERM in
xterm*|rxvt|Eterm|eterm)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
;;
screen*)
PROMPT_COMMAND='echo -ne "\033k${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\033\\"'
;;
esac
# Encrypted data vault handling
vaultmount(){
$SUDO_PREFIX /sbin/modprobe -q dm-crypt
$SUDO_PREFIX /bin/cryptsetup -c aes -h sha512 create secure /dev/hda6
mount /mnt/vault
}
vaultumount(){
umount /mnt/vault
$SUDO_PREFIX /bin/cryptsetup remove secure
}
# Gentoo service handling
srv(){
if [[ -z $1 ]] ; then
echo "Usage: srv <service> {start|stop|restart|status|save}"
else
case $2 in
start|stop|restart|status|save)
$SUDO_PREFIX /etc/init.d/$1 $2
;;
*)
echo "Usage: srv <service> {start|stop|restart|status|save}"
;;
esac
fi
}
# Emerge handling
esync(){
$SUDO_PREFIX /usr/bin/emerge sync
}
esynupw(){
$SUDO_PREFIX /usr/bin/emerge sync && $SUDO_PREFIX /usr/bin/emerge -uDavt world && $SUDO_PREFIX /usr/bin/glsa-check -t all
}
einst(){
if [[ -z $1 ]] ; then
echo "Usage: einst <arg>"
else
$SUDO_PREFIX /usr/bin/emerge $1
fi
}
efetch(){
if [[ -z $1 ]] ; then
echo "Usage: efetch <arg>"
else
$SUDO_PREFIX /usr/bin/emerge -f $1
fi
}
# USE flag handling
explainuseflag() {
sed -ne "s,^\([^ ]*:\)\?$1 - ,,p" /usr/portage/profiles/use.desc /usr/portage/profiles/use.local.desc
}
# Solaris style ping
isalive(){
if [[ -z $1 ]] ; then
echo "Usage: isalive <host>"
else
/bin/ping -q -c 1 $1 &> /dev/null
if [[ $? == 0 ]] ; then
echo "$1 is alive!"
else
echo "$1 not alvie!"
fi
fi
}
# The murder is always the gardener!
pkill(){
kill `pgrep $1`
}
pkill9(){
kill -9 `pgrep $1`
}
pkillsig(){
kill -s $1 `pgrep $2`
}
# CPU frequency status
cfreq(){
MINFREQ=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq`
MAXFREQ=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq`
if [[ $MINFREQ == $MAXFREQ ]] ; then
echo "CPU0: $(($MAXFREQ / 1000))MHz <"`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor`">"
else
echo "CPU0: $(($MINFREQ / 1000))-$(($MAXFREQ / 1000))MHz <"`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor`">"
fi
}
# LAN
lan(){
case $1 in
up)
$SUDO_PREFIX /etc/init.d/net.eth0 start
;;
down)
$SUDO_PREFIX /etc/init.d/net.eth0 stop
$SUDO_PREFIX /sbin/modprobe -q -r e1000
;;
*)
echo "Usage: lan {up|down}"
;;
esac
}
# WLAN
wlan(){
case $1 in
up)
$SUDO_PREFIX /etc/init.d/net.ath0 start
;;
down)
$SUDO_PREFIX /etc/init.d/net.ath0 stop
$SUDO_PREFIX /sbin/modprobe -q -r ath_pci
;;
*)
echo "Usage: wlan {up|down}"
;;
esac
}
# CD-Burning
cdrec(){
case $1 in
blank)
/usr/bin/cdrecord -v --dev=ATAPI:0,0,0 -blank=fast
;;
burn)
$SUDO_PREFIX /usr/bin/cdrecord driver=mmc_cdr driveropts=burnfree -v --dev=ATAPI:0,0,0 -speed=$2 $3
;;
*)
echo "Usage: cdrec {burn|blank} <speed> <img>"
;;
esac
}
pumask(){
echo "$1" >> /etc/portage/package.unmask
}
puse(){
echo "$1" >> /etc/portage/package.use
}
pkeyw(){
echo "$1 ~x86" >> /etc/portage/package.keywords
}
pumaskkeyw(){
echo "$1 ~x86" >> /etc/portage/package.keywords
echo "$1" >> /etc/portage/package.unmask
}
##uncomment the following to activate bash-completion:
#[ -f /etc/profile.d/bash-completion ] && source /etc/profile.d/bash-completion |
|
|
Back to top |
|
|
Pozican n00b
Joined: 26 Feb 2005 Posts: 56
|
Posted: Sun Apr 17, 2005 2:55 am Post subject: |
|
|
WOW -- Thanks, I'll start digging through this....
Are you sure you didn't get this mixed up with the massive source for kde or something?
lol, jk
Thanks man,
Poz |
|
Back to top |
|
|
inode77 Veteran
Joined: 20 Jan 2004 Posts: 1303 Location: Heart of Europe
|
Posted: Sun Apr 17, 2005 3:01 am Post subject: |
|
|
I hope not
Some stuff is sure thing junk or some late night addition so dig through it carefully. |
|
Back to top |
|
|
HAL_9000 Tux's lil' helper
Joined: 29 Sep 2004 Posts: 114 Location: Netherlands
|
Posted: Tue Apr 19, 2005 8:37 am Post subject: .bashrc |
|
|
your system's default normally is in /etc/skel/.bashrc _________________ We are the keepers of the sacred words: Ni peng and Nee wom! |
|
Back to top |
|
|
|