I have files that fall into two extension categories (.out and .error). Is there a single command that can delete them all at once?
I tried rm -f *.out || *.error
but it did not work. Thanks
(i saw the linked post too but am not sure how to deal with multiple extensions still)
Edit: non recursive case
shopt -s globstar; rm **/*.{out,error}
, orfind . -type f \( -iname '*.out' -o -iname '*.error' \) -delete
– muru Aug 16 '17 at 03:45rm *.out *.error
would have done what you want (-f if you need it, assuming current directory only) – guiverc Aug 16 '17 at 03:48rm *.out *error
. Note that muru's commands above are recursive -- i.e. they will delete files in subdirectories too. – wjandrea Aug 16 '17 at 04:14