Attributes and permissions of Linux files and directories -004
w and x work together to take effect
Attributes and permissions of Linux files and directories -005
setuid和setgid
The setuid and setgid bits allow ordinary users to run programs or commands that only the root account can run as the root user. (Note the difference with su and sudo) For
example, the passwd command, the final modification is /etc/passwd, and the owner and group of the file are both root.
Paste bit (understand)
Attributes and permissions of Linux files and directories -006
Ownership of files or directories
Change file ownership command chown
chown [选项]... [所有组][:组] 文件
chown oldboy:root test.txt
chown root.root test.txt
说明:chown所接的新的属生和新的属组之间应该以.或:连接,
属主和属组任意之一可以为空。如果属主为空,应该是:属组﹔如果属组为空就就不必需要.或:了。
chown也提供了参数,这个参数对目录改变属主和属组极为有用,我们可以通过加-R参数来改变某个目录下的所有文件到新的属主或属组;
Change the file's belonging group command chgrp
chgrp oldboy oldboy.txt
Detailed introduction and practice of Linux system hard link and soft link
Production use cases of soft links
END