shell script if condition file exists code example Example: bash script if file exists [ -f /etc/resolv.conf ] && echo "$FILE exists."