最近2018中文字幕在日韩欧美国产成人片_国产日韩精品一区二区在线_在线观看成年美女黄网色视频_国产精品一区三区五区_国产精彩刺激乱对白_看黄色黄大色黄片免费_人人超碰自拍cao_国产高清av在线_亚洲精品电影av_日韩美女尤物视频网站

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
Linux如何用命令管理文件和目錄的權(quán)限-創(chuàng)新互聯(lián)

Linux如何用命令管理文件和目錄的權(quán)限?針對這個問題,今天小編總結(jié)這篇有關(guān)linux文件和目錄權(quán)限的文章,可供感興趣的小伙伴們參考借鑒,希望對大家有所幫助。

十載的汝城網(wǎng)站建設(shè)經(jīng)驗(yàn),針對設(shè)計、前端、開發(fā)、售后、文案、推廣等六對一服務(wù),響應(yīng)快,48小時及時工作處理。營銷型網(wǎng)站的優(yōu)勢是能夠根據(jù)用戶設(shè)備顯示端的尺寸不同,自動調(diào)整汝城建站的顯示方式,使網(wǎng)站能夠適用不同顯示終端,在瀏覽器中調(diào)整網(wǎng)站的寬度,無論在任何一種瀏覽器上瀏覽網(wǎng)站,都能展現(xiàn)優(yōu)雅布局與設(shè)計,從而大程度地提升瀏覽體驗(yàn)。創(chuàng)新互聯(lián)公司從事“汝城網(wǎng)站設(shè)計”,“汝城網(wǎng)站推廣”以來,每個客戶項(xiàng)目都認(rèn)真落實(shí)執(zhí)行。

一、文件的權(quán)限和歸屬概述

1、訪問權(quán)限

  • 讀取r:允許查看文件內(nèi)容、顯示目錄列表;

  • 寫入w:允許修改文件內(nèi)容,允許在目錄中新建、移動、刪除文件或子目錄;

  • 可執(zhí)行x:允許運(yùn)行程序、切換目錄

2、歸屬(所有權(quán))

  • 屬主:擁有該文件或目錄的用戶賬號;

  • 屬組:擁有該文件或目錄的組賬號;

3、查看文件的權(quán)限和歸屬

Linux如何用命令管理文件和目錄的權(quán)限

4、chmod設(shè)置文件權(quán)限

chmod命令的基本語法格式如下:
Linux如何用命令管理文件和目錄的權(quán)限

應(yīng)用舉例:

[root@centos01 ~]# touch 1.txt   
[root@centos01 ~]# ll 
總用量 8
-rw-r--r--  1 root root   0 1月  11 22:27 1.txt
-rw-------. 1 root root 1572 10月 23 22:37 anaconda-ks.cfg
-rw-r--r--. 1 root root 1603 10月 23 23:36 initial-setup-ks.cfg
[root@centos01 ~]# chmod u+x ./1.txt  
[root@centos01 ~]# ll
總用量 8
-rwxr--r--  1 root root   0 1月  11 22:27 1.txt
-rw-------. 1 root root 1572 10月 23 22:37 anaconda-ks.cfg
-rw-r--r--. 1 root root 1603 10月 23 23:36 initial-setup-ks.cfg
[root@centos01 ~]# chmod u-x,g+x,o+w 1.txt  

[root@centos01 ~]# ll
總用量 8
-rw-r-xrw-  1 root root   0 1月  11 22:27 1.txt
-rw-------. 1 root root 1572 10月 23 22:37 anaconda-ks.cfg
-rw-r--r--. 1 root root 1603 10月 23 23:36 initial-setup-ks.cfg
[root@centos01 ~]# chmod 755 1.txt  
[root@centos01 ~]# ll
總用量 8
-rwxr-xr-x  1 root root   0 1月  17 02:36 1.txt
-rw-------. 1 root root 1572 10月 23 22:37 anaconda-ks.cfg
-rw-r--r--. 1 root root 1603 10月 23 23:36 initial-setup-ks.cfg

5、chown設(shè)置文件的歸屬

chown命令的基本語法格式如下:
Linux如何用命令管理文件和目錄的權(quán)限

應(yīng)用舉例:

[root@centos01 ~]# chown bob 1.txt  
[root@centos01 ~]# ll
總用量 8
-rwxr-xr-x  1 bob  root   0 1月  17 02:36 1.txt
-rw-------. 1 root root 1572 10月 23 22:37 anaconda-ks.cfg
-rw-r--r--. 1 root root 1603 10月 23 23:36 initial-setup-ks.cfg
[root@centos01 ~]# chown :benet 1.txt  
[root@centos01 ~]# ll
總用量 8
-rwxr-xr-x  1 bob  benet   0 1月  17 02:36 1.txt
-rw-------. 1 root root  1572 10月 23 22:37 anaconda-ks.cfg
-rw-r--r--. 1 root root  1603 10月 23 23:36 initial-setup-ks.cfg
[root@centos01 ~]# chown bob:benet 1.txt  
[root@centos01 ~]# ll
總用量 8
-rwxr-xr-x  1 bob  benet   0 1月  17 02:36 1.txt
-rw-------. 1 root root  1572 10月 23 22:37 anaconda-ks.cfg
-rw-r--r--. 1 root root  1603 10月 23 23:36 initial-setup-ks.cfg

二、目錄的權(quán)限和歸屬

1、訪問權(quán)限

Linux如何用命令管理文件和目錄的權(quán)限

2、歸屬(所有權(quán))

  • 屬主:擁有該目錄的用戶賬號;

  • 屬組:擁有該目錄的組賬號;

3、chmod設(shè)置目錄權(quán)限

chmod命令設(shè)置目錄權(quán)限的基本格式如下:
Linux如何用命令管理文件和目錄的權(quán)限

應(yīng)用舉例:

[root@centos01 ~]# chmod -R 755 benet/  
      
[root@centos01 ~]# ll
總用量 8
-rw-r-xrw-  1 root root   0 1月  11 22:27 1.txt
-rw-------. 1 root root 1572 10月 23 22:37 anaconda-ks.cfg
drwxr-xr-x  3 root root  18 1月  11 22:39 benet
-rw-r--r--. 1 root root 1603 10月 23 23:36 initial-setup-ks.cfg

4、chown設(shè)置目錄的歸屬

chown命令設(shè)置目錄歸屬的基本格式如下:
Linux如何用命令管理文件和目錄的權(quán)限

應(yīng)用舉例:

[root@centos01 ~]# chown -R bob:benet benet/  
  
[root@centos01 ~]# ll
總用量 8
-rw-r-xrw-  1 root root   0 1月  11 22:27 1.txt
-rw-------. 1 root root  1572 10月 23 22:37 anaconda-ks.cfg
drwxr-xr-x  3 bob  benet  18 1月  11 22:39 benet
-rw-r--r--. 1 root root  1603 10月 23 23:36 initial-setup-ks.cfg

三、權(quán)限掩碼umask

1、umask的作用

控制新建的文件或目錄的權(quán)限,默認(rèn)權(quán)限去除umask的權(quán)限就是新建的文件或者目錄的權(quán)限。

2、設(shè)置umask

umask 022

3、查看umask

umask

4、應(yīng)用舉例:

[root@centos01 ~]# umask  
0022
[root@centos01 ~]# umask 000  
[root@centos01 ~]# umask  
0000
[root@centos01 ~]# touch 2.txt  
[root@centos01 ~]# ll
總用量 8
-rwxr-xr-x  1 bob  benet   0 1月  17 03:48 1.txt
-rw-rw-rw-  1 root root   0 1月  17 03:48 2.txt   
-rw-------. 1 root root  1572 10月 23 22:37 anaconda-ks.cfg
-rw-r--r--. 1 root root  1603 10月 23 23:36 initial-setup-ks.cfg
[root@centos01 ~]# umask 022    
[root@centos01 ~]# umask      
0022
[root@centos01 ~]# touch 3.txt     
[root@centos01 ~]# ll
總用量 8
-rwxr-xr-x  1 bob  benet   0 1月  17 03:48 1.txt
-rw-rw-rw-  1 root root   0 1月  17 03:48 2.txt
-rw-r--r--  1 root root   0 1月  17 03:49 3.txt 
-rw-------. 1 root root  1572 10月 23 22:37 anaconda-ks.cfg
-rw-r--r--. 1 root root  1603 10月 23 23:36 initial-setup-ks.cfg

看完這篇文章,你們學(xué)會管理文件和目錄的權(quán)限的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀。

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。


當(dāng)前題目:Linux如何用命令管理文件和目錄的權(quán)限-創(chuàng)新互聯(lián)
鏈接分享:http://fisionsoft.com.cn/article/dsggoj.html