how to check if a file or directory exists in bash