1

I need to find all folders on a Linux server with directory name config and put a .htaccess in that directory containing "deny from all".

I'm currently trying to run:

find /home/www/sites/ -type d -name "config" -exec sh -c 'echo "deny from all" > .htaccess' \; 

But it doesn't work.

What have I missed?

1
  • Define "doesn't work".
    – womble
    Jul 28, 2012 at 2:35

1 Answer 1

1

Try

find /home/www/sites/ -type d -name "config" -exec sh -c 'echo "deny from all" > {}/.htaccess' \;
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .