参数 -R 用来递归实现更改所有子文件和子目录的权限。
1、利用chmod修改权限
对Document/目录下的所有子文件与子目录执行相同的权限变更:
chmod -R 700 文件名
700是变更后的权限表示(只有所有者有读和写以及执行的权限)
(chmod +x 文件名 >>> 使此文件变为可执行文件!)
2、利用chown改变所有者
修改所有者为users用户组的username用户:
chown -R username:users 文件名
username:users —— users用户组的username,用户组参数不是必须有。
例如sudo su后,在root用户下执行: chown -R liuchen:users 路径+文件名。 这样就把文件的所有者改成了 liuchen)