Linux下文件夹和文件权限批量修改

原来用过这个:

  
  
  
  
  1. chmod XXX `find ./ -type d` 

但是它不能处理文件路径中的空格。

最近了解了下,可以用如下的方式来解决:

文件夹授予权限 775(包括./):

   
   
   
   
  1. find ./ -type d -exec chmod 775 \{\} \;

文件授予权限664:

  
  
  
  
  1. find ./ -type f -exec chmod 664 \{\} \; 

 

你可能感兴趣的:(linux,权限,文件夹)