Bash cheatsheet

Useful commands

Variables

Special variables

Conditions

1
2
3
4
5
6
7
if [ ... ]; then
    # something
elif [ ... ]; then
    # something else
else
    # something else
fi

Conditional expressions

Always enclose variable with " "!