Bash Cheatsheet
Bash Cheatsheet
arithmetic
miscellaneous bc scripting
(( i = 99, j = i * i )) locales
mktemp renice echo $(( i == 99 ? 42 : 37 )) if test -e file; then echo EXISTS; else echo NOPE; fi
printf iconv strings locale if [ -e x ]; then A; elif [ -e y ]; then B; else C; fi
id groups who $LC_* while read -r; do echo "[$REPLY]"; done
crontab time watch printing for x in "$@"; do echo "[$x]"; done
tar zip for (( i=0; i<10; ++i )); do echo "$i"; done
whiptail zenity lpr lpq lprm lpstat lesystems case "$x" in foo*) echo Y;; *) echo N;; esac
perl python ruby mount fsck select x in A B C; do echo $x; [ -z "$x" ] || break; done
less nano vim networking df dd
ack git tree [[ "$x" =~ ^foo ]]
diff patch hostname cmd1 && cmd2 cmd || true !false test [
cal date ifconfig key bindings ( echo "subshell" ) { cmd1; cmd2; cmd3; } getopts
ping eval "$hopefully_not_evil_code" source
curl wget ^C SIGTERM ^D EOF exit
mutt rsync screen ^A home ^E end ^L clear # function
xdg-open nc say_hi () { local you="$1"; echo "Hi $you"; } return
TAB complete UP/DOWN history