I have a very specific and odd problem to solve. I'm working as a research assistant and I've been producing a ton of figures. In one directory, I dump .pngs to view casually (limited space here) and in the another, I dump .ps and .pdf files to use in latex. It's all automated with matlab. In the .png folder, I've periodically deleted many files I deemed not useful, but the other one is a mess.
How can I tell unix to go through the .ps directory, and for each file, search the .png directory for filenames that match, and then, if they don't match, move the file to a different directory (that I will most likely later delete)?
Are there any commands that could be useful here?