Skip to content

Instantly share code, notes, and snippets.

@BoyanXu
Created July 4, 2023 02:22
Show Gist options
  • Save BoyanXu/a29e262d9692e316c13d32b18c359331 to your computer and use it in GitHub Desktop.
Save BoyanXu/a29e262d9692e316c13d32b18c359331 to your computer and use it in GitHub Desktop.
Bash script to clean Syncthings syn conflict files
#!/bin/bash
# Go through each file with "sync-conflict" in its name
# -type f ensures we are only dealing with files (not directories)
find . -type f -name '*sync-conflict*' -print0 | while IFS= read -r -d '' file
do
# Check if file exists (it should, but let's be safe)
if [ -f "$file" ]; then
echo "Deleting $file"
rm "$file"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment