Ever need to check whether files in one folder exist in another folder? Here’s a quick bash script to do just that…
for file in * ; do [ -f ../images/$file ] && echo $file ; done
So, assuming you want to check that any files in your current folder already exist in the
../images folder, this bash script will print the names of any duplicate files.
All it’s doing is iterating over the file in your current folder, checking to see if that file exists in the
../images folder, and if ti does, print the file name.