Created
January 31, 2023 18:06
-
-
Save matissime/7ad2a75747d3ba45a6de91f8d14ea27b to your computer and use it in GitHub Desktop.
This little bash script is useful to manage and sort photo in bulk, once you deleted all the unwanted JPEG image, run the script in the folder to delete all the corresponding raw file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir unwanted #create a directory to store unwanted file | |
for file in *.NEF; do #for each .NEF find a .JPG file that as the same name | |
jpg_file="${file%.*}.JPG" | |
if [ ! -e "$jpg_file" ]; then #if a .NEF does not have a corresponding .JPEG file, move the .NEF file in the folder | |
mv "$file" ./unwanted/"$file" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment