I have 2 folders one contains images files and the second contains text files each text file have the same name as the image file and contains information about the image.eg:
-Labels:
-1.txt
-2.txt
-3.txt
-6.txt
-Images:
-1.jpg
-2.jpg
-3.jpg
-4.jpg
-5.jpg
-6.jpg
I want to delete images who has not a text file(in this example:4.jpg,5.jpg), I found a method how to determinate the different files but I can't delete them.
diff <(ls -1 ./Images | sed s/.jpg//g) <( ls -1 ./Labels | sed s/.txt//g)