bash if

Simple if:
if [ -d /etc]; then
echo "/etc exists"
fi
if with else
if [ -f /etc/fstab ]; then
  echo "/etc/fstab exists"
else
  echo "/etc/fstab does not exists"
fi
if with elif and else
if [ $1 = "y" ]; then
  echo "yes"
elif [ $1 = "n" ]; then
  echo "no"
else
  echo "other"
fi
if with test
if test -e /etc/hosts; then
  echo "/etc/hosts exists"
fi
if with || and [[ ]]
|| - other option is &&
[[ ]] - ability to use the entire expression within the brackets themselves, also fives possiblity to use regex and file globbing within expression
if [[ -f /etc/fstab || -d /var2 ]]; then
  echo "true"
else
  echo "false"
fi
if with && and [ ] [ ] - a single expression
if [ -f /etc/fstab ] && [ -d /var2 ]; then
  echo "true"
else
  echo "false"
fi