How can I check, in shell script, if any of two files exist?It doesn't matter which of the two files exist or if they both exist.
How do I check if either or both of the two files exist?
shell script;files;scripting
if test -e file1 || test -e file2; then  # At least one of file1 or file2 exists  ...else  # Neither file1 nor file2 existsfitest -e checks for mere existence. You may want a more specific test, such as -b (exists and is block special), -c (exists and is character special), -d (exists and is a directory), -f (exists and is a regular file) etc.