Mon .bashrc – My .bashrc

En fait, c’est accompagné d’un .bash.d/ avec aliases et tout le reste que ça peut être intéressant.

Loin de moi l’idée de suggérer que c’est le .bash parfait, mais il me convient =)

In fact, it is used with .bash.d/ with aliases and so on, that it is interesting.

Perish the thought that this is an ideal .bash, but it suits me =)

/home/login/.bash.d/aliases/

# -*- Shell-script -*-
#
unalias s 2> /dev/null
#pour la couleur
#for color
eval `dircolors`
alias ls="ls -F --color=tty"
alias ll="ls -lF"
alias la="ls -AlgFs"
#
alias more="less"
alias ccl="cd;clear"
#
# some more ls aliases
# -rt : les derniers crees a la fin
# -rt : last created in last
alias lrt='ls -r -t'
alias llrt='ls -lrt'
alias lll='ls -lrta'
alias ll='ls -l'
alias lla='ls -la'
alias la='ls -A'
alias l='ls -CF'
alias lm='ls -la |less'
#
#-----------------------------------------------------------------------------------
# Xlock |
#-----------------------------------------------------------------------------------
#alias xlock="xlock -logoutButton 150 -logoutCmd fin -mode maze"
function xlock (){
if [ $# -ge 1 ]; then
echo $@ > ~/.XlockIcqMessage
else
rm -f ~/.XlockIcqMessage
fi
xscreensaver-command -lock
}
alias caf="xlock 'Pause kawa !'"
alias manger="xlock 'Je suis parti manger !'"
alias reviens="xlock 'Je reviens... !'"
#-----------------------------------------------------------------------------------
# Commandes shell |
#-----------------------------------------------------------------------------------
alias ..="cd .."
alias rm="\rm -i"
alias mv="\mv -i"
alias cp="\cp -i"
#-u : si plus recent seulement
#-u : only if more recent
alias cpu="\cp -iu"
alias rmj="rm -f *.class"
alias ps="\ps -w"
#
#pour avoir une poubelle
#in order to get a trash
export POUBELLE=${HOME}/.wastebasket
function myrm {
mv $* $POUBELLE
}
alias rm=myrm
alias videpoubelle='/bin/rm -fr $POUBELLE; mkdir $POUBELLE'
#
#chmod all files/directory
alias chmodd='find . -type d -exec chmod 711 {} \;'
alias chmodf='find . -type f -exec chmod 755 {} \;'
#
#enlever tous les fichiers crees par latex
#remove all files created by latex
function unlatex(){
if [ "$1" == "" ]; then
return
fi
i=${1%%.*}
rm -f $i.aux $i.toc $i.lof $i.lot $i.los $i.?*~ $i.loa $i.log $i.bbl $i.blg $i.glo
rm -f $i.odt $i.tns $i.fax $i.bm $i.out $i.nav $i.snm
rm -f $i.mtc* $i.bmt
mv -f $i.dvi .$i.dvi
mv -f $i.ps .$i.ps
mv -f $i.pdf .$i.pdf
rm -f $i.dvi $i.ps $i.pdf
unset i
}
#
#supprimer les fichiers temporaires
#delete temporary files
alias rirm~="find . \( -name \"*~\" -o -name \".*~\" \) -exec \rm -i {} \;"
alias rrm~="find . \( -name \"*~\" -o -name \".*~\" \) -exec \rm {} \;"
alias irm~="find . -maxdepth 1 \( -name \"*~\" -o -name \".*~\" \) -exec \rm -i {} \;"
alias rm~="find . -maxdepth 1 \( -name \"*~\" -o -name \".*~\" \) -exec \rm {} \;"
#
#----------------------------------------------------------------------------------
# Processus |
#----------------------------------------------------------------------------------
alias fin="~/.bash.d/end_session.sh"
alias psm="ps axo pcpu,pmem,pid,user,comm | sort"
alias psc="ps axo pmem,pcpu,pid,user,comm | sort"
function psaux {
[ $# == 1 ] && ps aux | grep $1
}
#
#----------------------------------------------------------------------------------
# Mplayer|
#----------------------------------------------------------------------------------
#taille des sous-titres
#subtitles size
alias mplayer='mplayer -subfont-text-scale 3.5'
#completion mplayer
complete -f -X '!*.@(mp?(e)g|MP?(E)G|wma|avi|AVI|asf|vob|VOB|bin|dat|vcd|ps|pes|fli|viv|rm|ram|yuv|mov|MOV|qt|QT|wmv|mp3|MP3|ogg|OGG|ogm|OGM|mp4|MP4|wav|WAV|asx|ASX|mng|MNG|m4v)' mplayer
#
#----------------------------------------------------------------------------------
# Divers |
#----------------------------------------------------------------------------------
#
function comp {
[ $# == 1 ] && tar cvf - $1 | gzip -9 > $(basename $1).tgz
}
function decomp {
[ $# == 1 ] && gunzip -c $1 | tar xvf -
}
function code {
[ $# == 1 ] && tar cvf - $1 | gzip -c9 | uuencode $(basename $1).tgz > $(basename $1).tgz.uc
}
function decode {
[ $# == 1 ] && uudecode $1 -o /dev/stdout | gunzip -c | tar xvf -
}
alias gv='gv --noresize'
#
function psnup {
/usr/bin/psnup -2 -m30 -d $@
}
#
#----------------------------------------------------------------------------------
# apt |
#----------------------------------------------------------------------------------
alias agi='sudo apt-get install'
alias agu='sudo apt-get update'
alias agug='sudo apt-get upgrade'
alias agr='sudo apt-get remove'
alias acs='sudo apt-cache search'

/home/login/.bashrc

# Source global definitions
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
#sauvegarde de l'historique
#save of the history
HISTFILE=${HOME}/.bash.d/history
#
#lignes identiques non sauvegardées
#duplicates lignes are ignored
HISTCONTROL=ignoredups
#
#ajoute a la fin plutot que de reecrire
#append instead of overwrite
shopt -s histappend
#corrige quelques typos
#correct some typos
#cd .bashd => cd .bash.d
#cd .Bash.d => cd .bash.d
shopt -s cdspell
#
export HISTFILE
export HISTCONTROL
#
# Source les variables d'environnement
if [ -f ${HOME}/.bash.d/env ]; then
. ${HOME}/.bash.d/env
fi
#
# Source le fichier definissant le prompt
if [ -f ${HOME}/.bash.d/prompt ]; then
. ${HOME}/.bash.d/prompt
fi
#
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
#
# Source les completions perso
if [ -f ${HOME}/.bash.d/completion ]; then
. ${HOME}/.bash.d/completion
fi
#
# Source le fichier definissant les aliases
if [ -f ${HOME}/.bash.d/aliases ]; then
. ${HOME}/.bash.d/aliases
fi
#
unset debug
#
#force la taille des coredump a 0
#force coredump size to 0
ulimit -c 0
#
mesg y 2> /dev/null
eval $(lesspipe)

~ by loquehumaine on 2007, October 17 - Wednesday.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: