-1

I would like to delete 100k files and I use:

rm *.tif

Then I got:

bash: /usr/bin/rm: Argument list too long

So I tried:

find . -name '*.shp' | xargs rm -f

Then I got:

find: ‘./inaccessible’: Permission denied

How to solve the problem?

  • 1
    This is more a question for https://superuser.com/ or https://serverfault.com/ – Fryz Jun 17 '21 at 12:11
  • That's just a warning; you obviously cannot remove files you don't have access to. If you don't want your `find` command to try to visit subdirectories, add `--maxdepth 1`. Going forward, please search before asking; these are very common beginner questions. – tripleee Jun 17 '21 at 12:25

1 Answers1

0

Try with sudo find . -name '*.shp' -print -exec rm {} \; and let me know if it worked.

Regards.

Antonio Petricca
  • 8,891
  • 5
  • 36
  • 74