Linux 檔案和目錄許可權詳細介紹_Linux

來源:互聯網
上載者:User

Linux檔案和目錄許可權解讀

  

如何設定Linxu檔案和目錄的許可權

  

字元標記法

  
 

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

 2)chmod u=r file:把file檔案的當前(使用者user)的許可權賦值為可寫入模式

 3)chmod g=wrx file:把file檔案的當前(組gruop)的許可權賦值為可寫,可讀,可執行模式

 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)的許可權設為可讀可寫可執行模式

 註:

如果執行修改許可權出現 Operation not permitted 請在命令前面加sudo chmod -R 777 file

感謝閱讀,希望能協助到大家,謝謝大家對本站的支援!

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.