歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> linux更改一個文件f1的用戶主為user,用戶組為group代碼

linux更改一個文件f1的用戶主為user,用戶組為group代碼

日期:2017/3/2 10:01:46   编辑:關於Linux

chown user:group /path/to/f1

比如.profile先前的owner和group都是root
root@cyper-pc:/home/dasusr1# ls -al /home/dasusr1/.profile
-rw-r--r-- 1 root root 675 Jan 6 00:09 /home/dasusr1/.profile

使用chown命令更改之:
root@cyper-pc:/home/dasusr1# chown dasusr1:dasadm .profile

重新查看:

root@cyper-pc:/home/dasusr1# ls -al /home/dasusr1/.profile
-rw-r--r-- 1 dasusr1 dasadm 675 Jan 6 00:09 /home/dasusr1/.profile

Copyright © Linux教程網 All Rights Reserved