Use the test command or bracket syntax with the -f flag to check whether a file exists in Bash, with -d for directories, -e for both, and negation with !