chown bin install.log
ls -l
-rw-r--r-- 1 bin users 68495 Jun 25 08:53 install.log
chown root:root install.log
ls -l
-rw-r--r-- 1 root root 68495 Jun 25 08:53 install.log
/* Change the owner and group of the file that FD is open on. */
extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __THROW __wur;
对于连接文件,则可以使用 lchown 函数。其参数同于 chown 函数。
/* Change owner and group of FILE, if it is a symbolic link the ownership of the symbolic
link is changed. */
extern int lchown (__const char *__file, __uid_t __owner, __gid_t __group) __THROW __nonnull ((1)) __wur;