When I revert in Mercurial, it leaves several .orig
files. I would like to be able to run a command to remove all of them.
I have found some sources that say to run:
rm **/*.orig
But that gives me the message:
rm: cannot remove `**/*.orig': No such file or directory
I have also tried these commands:
rm -rv *.orig
rm -R *\.orig
Use the
find
command (with care!)I've commented out the delete command but once you're happy with what it's matching, just remove the
#
from the line and it should delete all those files."find" has some very advanced techniques to search through all or current directories and rm files.
I have removed all files that starts with .nfs000000000 like this
The below is what I would normally do
It's a good idea to check what files you'll be deleting first by checking the
xargs
. The below will print out the files you've found.If you notice a file that's been found that you don't want to delete either tweak your initial
find
or add agrep -v
step, which will omit a match, ie