Linux Learning Commands Summary ⑧

Source: Internet
Author: User

#chown命令: Changes the file's owner and host groups by Chown. When you change the owner or group of a file, you can use the user name and user identification code settings. A normal user cannot change his or her files to another owner. Its operation permissions are generally administrators.

Modified file owner and owner group:

[[Email Protected]_168_102_centos ~]# ls-8drwxr-xr-x 2 Wanghan HX      4096-10:32 abedrwxr
    C5>-xr-x 2 root    wanghan 409610:32~ ~]# ls-8drwxr-xr-x 2 root root    4096 10:32 abedrwxr-xr-x 2 root wanghan 4096-10:32 Xab
[[Email Protected]_168_102_centos ~~]# ls-8drwxr-xr-x 2 user1 wanghan 4096-10:32 AB Edrwxr-xr-x 2 root  wanghan 4096 10:32 Xab

To modify only the group of files:

[[Email Protected]_168_102_centos ~]# ls-8drwxr-xr-x 2 user1 wanghan 4096-10:32 abedrwxr  >-xr-x 2 root  wanghan4096 10:32~ ~]# ls-8drwxr-xr-x 2 user1 root    4096 abedrwxr-xr-x 2 root wanghan 4096 10:32 10:32 xab  

Modify the owner of the file and belong to the group automatically modified to its owner corresponding to the genus Group

[[Email Protected]_168_102_centos ~]# ls-8drwxr-xr-x 2 user1 root    4096-10:32 abedrwxr
    C3>-xr-x 2 root  wanghan4096 10:32~ ~]# ls-8drwxr-xr-x 2 Wanghan HX      40 abedrwxr-xr-x 2 root wanghan 4096 10:32 10:32 xab    

Chown–r: The owner or group of the recursive processing file

[Email protected]_168_102_centos tmp]# LS-Ltotal4srwxrwxrwx1 root root 0 9 10:05Agent_cmd.sock-RW-------1 root root 0 4 13:58AP_1014.PIDDRWXR-xr-x 3 Wanghan wanghan 4096 11 15:52ceshi[[email protected]_168_102_centos tmp]# ls-L ceshi/ Total4drwxr-xr-x 2 Wanghan wanghan 4096 11 15:52 123[email protected]_168_102_centos tmp]# chown-R Root:root ceshi/[[email protected]_168_102_centos tmp]# ls-L Total4srwxrwxrwx1 root root 0 9 10:05Agent_cmd.sock-RW-------1 root root 0 4 13:58AP_1014.PIDDRWXR-xr-x 3 root root 4096 11 15:52ceshi[[email protected]_168_102_centos tmp]# ls-L ceshi/ Total4drwxr-xr-x 2 root root 4096 11 15:52 123

#chgrp命令: Modifying a file group

[[Email Protected]_168_102_centos tmp]# ls-41 root root    0  9 10:05 Agent_cmd.sock -rw-------1 root root    0  4 13:58 ap_1014.piddrwxr-xr-x 3 root root 4096-15:52-
   
    4
    1 root root       0  9 10:05
     agent_cmd.sock-rw-------1 root root       0  4 13:58
     ap_1014.piddrwxr-xr-x 3 root wanghan 4096-15:52 Ceshi
   

Chgrp-r: Recursive processing

[Email protected]_168_102_centos tmp]# LS-Ltotal4srwxrwxrwx1 root root 0 9 10:05Agent_cmd.sock-RW-------1 root root 0 4 13:58AP_1014.PIDDRWXR-xr-x 3 root root 4096 11 15:52ceshi[[email protected]_168_102_centos tmp]# ls-L ceshi/ Total4drwxr-xr-x 2 root root 4096 11 15:52 123[email protected]_168_102_centos tmp]# chgrp-R user1 ceshi/[[email protected]_168_102_centos tmp]# ls-Ltotal4srwxrwxrwx1 root root 0 9 10:05Agent_cmd.sock-RW-------1 root root 0 4 13:58AP_1014.PIDDRWXR-xr-x 3 root user1 4096 11 15:52ceshi[[email protected]_168_102_centos tmp]# ls-L ceshi/ Total4drwxr-xr-x 2 root user1 4096 11 15:52 123

#chmod命令:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.