Thursday, 15 September 2011

linux - How to find files with same name part in directory using the diff command? -


I have two directories in those files numbered end in directory A (e.g., Janet1.jpg laura2.jpg) and Directory B There is a list of photos, which have the same files except the different numbered end (e.g., Janet41.jpg laura33.jpg). How can I find files while ignoring the numbered end, which does not have a file related to Directory A and B? For example, in directory A, there is a Rachel 3, but there is no Rachel in the Directory B. I think there is a way of doing this with Bash in the Dipife Command, but I have no clear way to do this.

I see no way to directly use diff for this It is possible to use a sums tool ( md5 , sha1 , etc.) on both directories and then sorting both files based on the first (Yoga) column and the difference It would be possible to compare those output files.

Alternatively, something like that (which is not as simple as diff or any amount check) is a simple (and possibly more useful) solution.


No comments:

Post a Comment