我需要find目录名称为config的Linux服务器上的所有文件夹,并在包含“ deny from all ”的目录中放入一个.htaccess 。
我目前正在尝试运行:
find /home/www/sites/ -type d -name "config" -exec sh -c 'echo "deny from all" > .htaccess' \;
但它不起作用。
我错过了什么?
尝试
find /home/www/sites/ -type d -name "config" -exec sh -c 'echo "deny from all" > {}/.htaccess' \;