I have a file that lists filenames, each on it\'s own line, and I want to test if each exists in a particular directory. For example, some sample lines of the file might be
I wanted to add one small comment to most of the above solutions. They are not actually testing if a particular file exists or not. They are checking to see if the file exists and you have access to it. It's entirely possible for a file to exist in a directory you do not have permission to in which case you won't be able to view the file even though it exists.