Well, I have struggled enough to create my ~/.bashrc. Here it is, so that I will always get it from anywhere, from my jobplace as from home. Hoping it will inspire some unlikly readers.
# If not running interactively, don't do anything[ -z "$PS1"]&&return# don't put duplicate lines in the history. See bash(1) for more options# don't overwrite GNU Midnight Commander's setting of `ignorespace'.HISTCONTROL=$HISTCONTROL${HISTCONTROL+:}ignoredups
# ... or force ignoredups and ignorespaceHISTCONTROL=ignoreboth
# append to the history file, don't overwrite itshopt -s histappend
# check the window size after each command and, if necessary,# update the values of LINES and COLUMNS.shopt -s checkwinsize
PS1='\[\033[01;32m\]\u\[\033[01;34m\]@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '[["$HOME"=="/root"]]&&PS1='\[\033[01;31m\]\u\[\033[01;32m\]@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]:~# 'alias ls='ls --color=auto'alias sl='ls'alias dc='cd'[[ -f ~/.bash_aliases ]]&& . ~/.bash_aliases
[[ -f /etc/bash_completion ]]&& ! shopt -oq posix && . /etc/bash_completion
ipgrep (){ grep -Ern "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" .
}Egrep (){if[$# -eq 1 ]; thengrep -Ev "#|^$"$1elif[$# -eq 2 ]; thengrep -Ev "$2|^$"$1elseecho"Usage: Egrep file [char]"fi}export dev="/home/philippe/Documents/dev"export nb="/home/philippe/Documents/dev/newbie-contest"export o="$dev/octopress/octopress"export t="$dev/twitter-bootstrap/bootstrap/"export HISTSIZE=2000
export HISTIGNORE='history*'# I like using Ctrl+<- to move backward word and Ctrl+-> to move forward-wordbind'"\e\x5b\x31\x3b\x35\x44"':backward-word
bind'"\e\x5b\x31\x3b\x35\x43"':forward-word
# https://stackoverflow.com/questions/945288/saving-current-directory-to-bash-historyhcmnts(){export HISTTIMEFORMAT=local hcmnt
local cwd
local extra
hcmnt=$(history 1)hcmnt="${hcmnt# *[0-9]* }"if[[${hcmnt%% *}=="cd"]]thencwd=$OLDPWDelsecwd=$PWDfiextra=$(eval"$hcmntextra")hcmnt="${hcmnt% ### *}"hcmnt="$hcmnt ### ${extra:+$extra }$cwd"history -s "$hcmnt"}export hcmntextra='date +"%d-%m-%Y %H:%M:%S"'export PROMPT_COMMAND='hcmnts'killbill(){PROCESS_NAME=$1for i in $(ps aufx | grep ${PROCESS_NAME} | grep -v grep | awk '{printf $2}');
do if[[$2=="-t"]]; thenecho$i;
elsekill -9 $i;
fi done}
Unfortunately, I won’t allow any comment on my blog, at least for now. No one would give me some hints about their own bashrc; But anyway, I won’t get less Spam and a static blog is always easier to protect than a dynamic one.