Im using the find command to find common files between two directories:
find "$SOURCE" "$TARGET" -printf "$TARGET%P\n" | sort | uniq -d
problem is it always outputs an empty line on the top. Due to that when I try to delete the common files from the source like this:
find "$SOURCE" "$TARGET" -printf "$TARGET%P\n" | sort | uniq -d | xargs rm
I get error:
rm: cannot remove ‘/target/directory/path’: Is a directory
How top get rid of the extra line