I tried running
locate *.orig | xargs rm
but it said
No such file or directory
I've seen ways to do it with
find but locate returns the full path to the object so it should be possible
If filenames contain spaces you should use
Also, you should protect
locate doesn't do the globbing, but the shell does. The shell expands *.orig to what it finds in the current directory which matches *.orig.
and if that gets you what you need
or, as enzotib mentioned
if you have Whitespace in the filenames.
A trick : Save all paths in tmp file . then , Loop on it: