Skip to content

Instantly share code, notes, and snippets.

@syrte
Created June 4, 2024 21:27
Show Gist options
  • Save syrte/a6b90c1e1f8f31936d7c24a00087a2a7 to your computer and use it in GitHub Desktop.
Save syrte/a6b90c1e1f8f31936d7c24a00087a2a7 to your computer and use it in GitHub Desktop.
copy from stackoverflow.
#!/bin/bash
for image_file in $(ls figs6/)
do
if grep $image_file */*.log -c > 1
then
echo "File $image_file is in use."
else
echo "File $image_file is not in use."
mv "figs6/$image_file" "figs6/moved.$image_file" # or any other action
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment