我正在检查一些配置并找到了这个。任何人都可以帮我解释/bin/chown -Rf ownername:groupname folderpath
的意思吗?
答案 0 :(得分:0)
离;
示例文件和文件夹;
user@user:/tmp/1$ ls -arlt
-rw-rw-r-- 1 user user 0 Tem 28 14:29 test1
-rw-rw-r-- 1 user user 0 Tem 28 14:29 test2
drwxrwxr-x 2 user user 4096 Tem 28 14:30 folder
user@user:/tmp/1$ ls -arlt folder/
---------- 1 user user 0 Tem 28 14:30 test1
没有任何参数;错误信息如下所示;
user@user:/tmp/1$ find . -type f -name "*" | xargs chown bin.bin
chown: changing ownership of ‘./folder/test1’: Operation not permitted
chown: changing ownership of ‘./test2’: Operation not permitted
chown: changing ownership of ‘./test1’: Operation not permitted
-f抑制这个消息,并且
-R还更改文件夹中的test1文件。
user@user:/tmp/1$ find . -type f -name "*" | xargs sudo chown -Rf bin.bin
[sudo] password for user:
user@user:/tmp/1$ ls -lart
total 80
-rw-rw-r-- 1 bin bin 0 Tem 28 14:29 test1
-rw-rw-r-- 1 bin bin 0 Tem 28 14:29 test2
drwxrwxr-x 2 user user 4096 Tem 28 14:30 folder
user@user:/tmp/1/folder$ ls -arlt
total 8
---------- 1 bin bin 0 Tem 28 14:30 test1