`find ... | xargs rm` fails with `xargs: unmatched single quote; by default quotes are special to xargs unless you use the -0 option`
IntermediateTroubleshootingTroubleshooting: quoting, expansion and tool-input bugs
Answer
Likely causes → A filename contains an apostrophe (O'Brien report.pdf). Default xargs parses quotes and whitespace, so it chokes, and names with spaces would be split.
Diagnose → find ... | grep "'" finds the offending names.
Fix → NUL-separated end to end: find /data -name '*.tmp' -print0 | xargs -0 -r rm -f --, or find /data -name '*.tmp' -delete.
Prevent → Always pair -print0 with xargs -0, or avoid xargs for deletes entirely.
More on Troubleshooting: quoting, expansion and tool-input bugs
`bash: [: too many arguments`Beginner`bash: [: =: unary operator expected`BeginnerA disk check fails with `[: 93%: integer expression expected`Beginner`rm $file` fails with `rm: cannot remove 'monthly': No such file or directory` and `rm: cannot remove 'report.csv'`.BeginnerA cleanup script logs `cp: cannot stat '/var/log/app/*.log': No such file or directory` on quiet days.Beginner`echo "start" > $logfile` fails with `bash: $logfile: ambiguous redirect`Intermediate