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?

1
  • For confirmation of overwrite, add -i to the cp flags. Commented Nov 5, 2011 at 9:56

1 Answer 1

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 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.