I have some duplicate files in directories A and B, how could I delete the dupes in B using the filenames from A in bash?How to do it in other shell's is a welcome bonus.
How to remove matching files from directory A in directory B in the command line?
bash;shell;files;filenames;rm
One way:#!/bin/bashcd ~/Bfor file in ~/A/*do    file1=$(basename $file)    [ -f $file1 ] && { echo deleting $file1 ; rm -- $file1; }done