bashrc
disable ctrl-s locks terminal
stty -ixon
history size
HISTSIZE=10000
HISTFILESIZE=20000
setting a bash prompt
\d date
\h hostname (up to .)
\H hostname (full)
\n newline
\r carriage return
\s shell name
\t the time
\u username
\v version of bash
\w working directory (path)
\W working directory (base)
\$ # for root, $ for normal user
\\ backslash
\[ ansi color code
example: user @ host: path
PS1='\u@\h:\w\$'
.bashrc example: colored prompt if colors are available
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
bash prompt generator
https://scriptim.github.io/bash-prompt-generator/