bashrc

The purpose of this document is to explain how to configure .bashrc, .bash_profile, and .vimrc.

vim /root/.bashrc

# Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi export TERM="vt100"

vim /root/.bash_profile

# .bashrc # User specific aliases and functions alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi PATH=$PATH:$HOME/bin # Make listing files better alias l='ls -lahF --color=auto --classify --group-directories-first --time-style=long-iso' # Convenient aliases alias egrep='egrep --color=auto' alias fgrep='fgrep --color=auto' alias grep='grep --color=auto' # Find your own IP alias myip="wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'" # Better process listing alias psa="ps -Af" alias psag="ps -Af | grep" # Less stuff export LESS="-R" # Easier exit alias x="exit" # Handy cd alias ..='cd ..' alias ...='cd ../../' alias ....='cd ../../../' alias .....='cd ../../../../' # Use VIM please alias vi=vim # LS Colors easier on eyes in Windows - see https://github.com/Microsoft/vscode/issues/7556 and https://askubuntu.com/questions/466198/how-do-i-change-the-color-for-directories-with-ls-in-the-console LS_COLORS=$LS_COLORS:'di=1;36:' ; export LS_COLORS # Colour defaults RED='\e[0;31m' red='\e[1;31m' BLUE='\e[0;34m' blue='\e[1;34m' CYAN='\e[0;36m' cyan='\e[1;36m' NC='\e[0m' # Cool dstat alias dstata='dstat --cpu --load --proc --mem --disk --filesystem --io --net --float' # ifconfig alias for systems with ip # alias ifconfig="ip addr show" # see https://unix.stackexchange.com/questions/145447/ifconfig-command-not-found # A better prompt PS1="\n${cyan}\D{%Y-%m-%d %H:%M:%S}${NC} at ${red}\!${NC} as ${red}\u@\H${NC} in ${cyan}\w${NC} \n# " alias bish='export PS1="\n${cyan}\D{%Y-%m-%d %H:%M:%S}${NC} at ${red}\!${NC} as ${red}\u@\H${NC} in ${cyan}\w${NC} \n# "' # A small prompt for small people alias smsh='export PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$ "' # Way better history per http://blog.sanctum.geek.nz/better-bash-history/ # and http://northernmost.org/blog/flush-bash_history-after-each-command/ export HISTFILESIZE=1000000 # Allow for a really long history file export HISTSIZE=1000000 # Allow for a really long active history alias histl='history | less' shopt -s histappend # Append to history rather than overwriting it export HISTTIMEFORMAT='%F %T ' # Include both the date and the time in ISO format for each history line export PROMPT_COMMAND='history -a' #export PROMPT_COMMAND='history -a; history -n' # This writes the most recent command to the history file # # and then reads any previously unread lines from the history, # # thus syncing histories between currently active sessions. alias hista='history -a; history -n' # Use an alias instead of the PROMPT_COMMAND to avoid making things go crazy # Get completion scripts, etc. # source ~/.bashrc.d/* # Git aliases alias push='git push origin' alias pull='git pull --rebase'

vim /root/.vimrc

syntax on colorscheme desert set number set nowrap autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o nnoremap <CR> :noh<CR><CR>

[Edit]