linux修改文件權限和用戶組管理小結


經常會用到的命令,記一下。

1.chgrp修改文件所屬組

#簡單使用,將文本test.txt所屬組改為gourp1

chgrp gourp1 test.txt

2.chown修改文件擁有者

#將test.txt文件所屬用戶修改為user1

chown user1 test.txt 

#同時修改test.txt的所屬用戶和所屬組

chown user1:group1 test.txt

3.chmod修改文件屬性

chmod 755 test

chmod u+x test

chmod u-x test

chmod g+x test

4.usrmod修改用戶所屬組

一般的話只是將當前用戶添加到其它組中去

usrmod -a -G group1 user1

如果要徹底更改用戶所屬的組的話使用

usrmod -g group1 user1


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM