请问如何改变目录内所有档案的权限但不包含资料夹?
Tofloor
poster avatar
la******ng@outlook.com
deepin
2017-04-16 06:48
Author
不小心因為 Deepin File Manager 的分享功能造成整个家目录下的档案都变成可执行档,想要把它改回来但又会改到目录本身的权限,请问有什么指令办得到呢?

Reply Favorite View the author
All Replies
avatar
la******ng@outlook.com
deepin
2017-04-16 06:55
#1
找到了这两个好用的指令
1. 只修改 /home/abc 底下所有資料夾的權限(不含檔案)
  1. find /home/abc -type d -exec chmod 755 {} \;
Copy the Code

2. 只修改 /home/abc 底下所有檔案的權限(不含資料夾)
  1. find /home/abc -type f -exec chmod 644 {} \;
Copy the Code


现在麻烦的是还要把可执行的档案找出来
Reply View the author
avatar
山西姚一
deepin
2017-04-17 07:20
#2
恩恩 谢谢分享。
Reply View the author