0

i found this online it copy file to every sub folder on the current dir for full tree depth

find -maxdepth 1 -type d -print0 | xargs -0 -n1 cp -v  .htaccess

now would be nice if it could ask if the file already exist or at least overwrite if file already exists.

Is there way to reverse this command so it can actually remove matching file from every subfolder?

JohnA
  • 101

1 Answers1

1

Find is extremely versatile, the -delete and -name pattern options may helpful for what you want.

find -maxdepth 1 -type f -name '.htaccess' -delete
Zoredache
  • 128,755
  • 40
  • 271
  • 413