I am trying to call xargs, however rm is complaining
find . -maxdepth 1 -name "*tests*" -print0 | xargs -0 rm
rm: missing operand
Try `rm --help' for more information.
I am trying to call xargs, however rm is complaining
find . -maxdepth 1 -name "*tests*" -print0 | xargs -0 rm
rm: missing operand
Try `rm --help' for more information.
find . -maxdepth 1 -name "*tests*" -print0 | xargs -0 -I {} rm {}
It's because your find doesn't return any filename. Try either:
xargs -r0 rm
Or directly:
find ... -delete
if your find implementation supports it.
Or:
find ... -exec rm {} +
Ruby
ruby -e 'Dir["*tests*"].each {|x| File.delete(x) }'