Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲

Linux 檔案與目錄權限詳解:字符表示法與 chmod 用法

編輯:關於 Android 開發

Linux 檔案與目錄權限詳解:字符表示法與 chmod 用法

轉載請標明出處: 
https://www.cnblogs.com/why168888/p/5965180.html

本文出自:【Edwin博客園】

本文說明如何設定 Linux 檔案與目錄的權限,並介紹字符表示法。

1)ls -l:查看所在目錄所有檔案的權限。

2)chmod u=r file:把 file 檔案目前(使用者 user)的權限賦值為唯讀模式。

3)chmod g=wrx file:把 file 檔案目前(群組 group)的權限賦值為可讀、可寫、可執行模式。

4)chmod g-x file:把 file 檔案目前(群組 group)的權限減去可執行模式。

5)chmod o+w file:把 file 檔案目前(所有人 other)的權限加上可寫模式。

6)chmod a-x file:把 file 檔案目前(使用者 user、群組 group、所有人 other)的權限減去可執行模式。

7)chmod 777 file:把 file 檔案目前(使用者 user、群組 group、所有人 other)的權限設為可讀、可寫、可執行模式。

8)chmod -R 777 file:以遞歸方式,把 file 目錄底下所有檔案與資料夾的(使用者 user、群組 group、所有人 other)權限設為可讀、可寫、可執行模式。

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © Android教程網 All Rights Reserved