Skip to content

Instantly share code, notes, and snippets.

@brahimmachkouri
Last active May 22, 2020
Embed
What would you like to do?
bashrc
alias ll='ls -laFh'
alias h='history'
alias cd..='cd ..'
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
bleu="\[\e[0m\]\[\e[00;34m\]"
blanc="\[\e[0m\]\[\e[01;37m\]"
rouge="\[\e[0m\]\[\e[01;31m\]"
violet="\[\e[0m\]\[\e[01;35m\]"
gris="\[\e[0m\]\[\e[00;37m\]"
vert="\[\e[0m\]\[\e[01;32m\]"
jaune="\[\e[0m\]\[\e[01;33m\]"
#ip=$(/sbin/ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ printf "%s|",$1}' | sed 's/.$//')
#ubuntu 17.10
#ip=$(/sbin/ifconfig | grep 'inet '| grep -v '127.0.0.1' | awk '{ printf "%s|",$2}' | sed 's/.$//')
#ubuntu 18.04
ip=$(/sbin/ip addr | grep 'inet '| grep -v '127.0.0.1' | awk '{ printf "%s|",$2}' | sed 's/.$//')
#for macOS :
#ip=$(/sbin/ifconfig | grep 'inet '| grep -v '127.0.0.1' | awk '{ printf "%s|",$2}' | sed 's/.$//')
heure="$jaune\A "
user="$bleu\u "
user+="$blanc[$ip] "
host="$rouge[\H] "
chemin="$violet\w\n"
prompt="$vert\\$ "
end="$gris\[\e[0m\]"
export PS1=$heure$user$host$chemin$prompt$end
export LSCOLORS=ExFxBxDxCxegedabagacad
function cd() {
new_directory="$*";
if [ $# -eq 0 ]; then
new_directory=${HOME};
fi;
builtin cd "${new_directory}" && ll
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment