I need to recurse a directory and delete all the files with js and map extensions.
what i currently have that does not work is
find . -name *.js -or -name *.map | xargs rm
Anything obvious wrong with this command?
The shell is probably expanding the arguments to find. Quote them:
find . \( -name '*.js' -or -name '*.map' \) -delete
xargs rmtoxargs echoand validate your output. Secondly, try the actual command from the command line before you go and alias it. So run that find command in the shell and see what you get. You should see the names of all the files that it finds. If empty, you have issues with the filenames or no files.-ocan also be written as-or(same for-aand-and). But the longer forms seem to be GNU extensions, not mandated by POSIX, so it might be safer to use-o.