2018-05-14 01:18:46 +02:00
|
|
|
# If .bashrc.d directory exist, load .conf files
|
2018-06-15 19:22:24 +02:00
|
|
|
if [[ -f ~/.bashrc.d/*.conf ]]; then
|
2018-05-14 01:18:46 +02:00
|
|
|
for bashrc_d_file in ~/.bashrc.d/*.conf ; do
|
|
|
|
. $bashrc_d_file
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
# alias
|
|
|
|
export LS_OPTIONS='--color=auto'
|
2018-12-03 05:45:05 +01:00
|
|
|
eval "`dircolors`"
|
|
|
|
alias ls='ls $LS_OPTIONS -h'
|
|
|
|
alias ll='ls $LS_OPTIONS -lh'
|
|
|
|
alias l='ls $LS_OPTIONS -lAh'
|
2018-05-14 01:18:46 +02:00
|
|
|
|
2018-05-30 01:03:27 +02:00
|
|
|
# Some more alias to avoid making mistakes:
|
2018-05-14 01:18:46 +02:00
|
|
|
alias rm='rm -i'
|
|
|
|
alias cp='cp -i'
|
|
|
|
alias mv='mv -i'
|
|
|
|
|
2018-05-30 01:03:27 +02:00
|
|
|
# Color grep
|
2018-05-14 01:18:46 +02:00
|
|
|
alias grep='grep --color=auto'
|
|
|
|
alias fgrep='fgrep --color=auto'
|
|
|
|
alias egrep='egrep --color=auto'
|
|
|
|
|
|
|
|
# Git :
|
|
|
|
alias ggb="cd /srv/git/basic_config_debian"
|
|
|
|
alias gs="git status"
|
|
|
|
alias gd="git diff"
|
|
|
|
alias ga="git add"
|
|
|
|
alias gb="git branch"
|
|
|
|
alias gc="git commit"
|
|
|
|
alias gca="git commit -v -a"
|
|
|
|
alias gcam="git commit --amend -v"
|
|
|
|
alias gp="git push origin master"
|
|
|
|
alias gl="git log"
|
|
|
|
alias gll="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
|
|
|
|
|
2018-05-30 01:03:27 +02:00
|
|
|
# Network
|
|
|
|
alias ipa='ip -color addr show'
|
|
|
|
alias ip4a='ip -4 -color addr show'
|
|
|
|
alias ip6a='ip -6 -color addr show'
|
|
|
|
|
2018-05-14 01:18:46 +02:00
|
|
|
# PS1
|
2018-05-30 01:03:27 +02:00
|
|
|
case $(systemd-detect-virt) in
|
|
|
|
"qemu") PS1_COLOR="34m";; # Blue
|
|
|
|
"lxc") PS1_COLOR="33m";; # Orange
|
|
|
|
*) PS1_COLOR="32m";; # Green
|
|
|
|
esac
|
|
|
|
export PS1="\[\033]0;\u@\h - \w\007\]\[\e[$PS1_COLOR\]root@\h\[\e[0m\] [\[\e[0m\]\t\[\e[0m\]][\[\e[34m\]\w\[\e[0m\]]$ "
|
2018-05-14 01:18:46 +02:00
|
|
|
|
|
|
|
# History format
|
|
|
|
HISTTIMEFORMAT='%Y-%m-%d %H:%M:%S '
|
|
|
|
|