Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> Linux 教學

Linux 批量修改文件權限與所有者:chmod、chown 遞歸操作實戰

編輯:Linux 教學

chmod -R 遞歸修改權限

chmod -R 700 /opt/oracle/
  • -R:遞歸處理目錄下所有文件及子目錄
  • 700:八進制權限,僅所有者有讀寫執行權限(rwx------)

chown -R 遞歸修改所有者與組

chown -R oracle:oinstall /opt/oracle/
  • -R:遞歸
  • oracle:oinstall:用戶 oracle,組 oinstall(組可省略,僅改用戶用 chown -R oracle /path)

常見權限數值對照

數值二進制權限含義
7111rwx
6110rw-
5101r-x
4100r--
0000---

三位數分別對應:所有者、同組用戶、其他用戶。

符號模式(更直觀)

chmod -R u+rwx,g-rwx,o-rwx /opt/oracle/  # 等同 700
chown -R :oinstall /opt/oracle/          # 僅修改組
Copyright © Windows教程網 All Rights Reserved