2016-07-28 2 views
0

私はいくつかの設定を確認しており、これが見つかりました。誰でも助けて/bin/chown -Rf ownername:groupname folderpathの意味を説明できますか?/bin/chownの意味-Rf ownername:groupname path

+2

'chown'は'ファイル所有者とグループを変更する 'コマンドです。 '-R'は再帰的に意味します。 '-f'はエラーメッセージを抑止することを意味します。 more info: 'man chown' – sat

+0

-Rfに何をするのかを知りたいのですが?言及された経路で再帰的に取得しているエラーに関する情報を提供しますか? – Jhansi

答えて

0

ex;

サンプルファイルとフォルダ。

[email protected]:/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 


[email protected]:/tmp/1$ ls -arlt folder/ 
---------- 1 user user 0 Tem 28 14:30 test1 

パラメータなし。エラーメッセージは以下のように表示されます。

[email protected]:/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 

また、フォルダ内のtest1のファイルを変更するには、このメッセージを指定し、
-Rを抑制-f。

[email protected]:/tmp/1$ find . -type f -name "*" | xargs sudo chown -Rf bin.bin 
[sudo] password for user: 
[email protected]:/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 

[email protected]:/tmp/1/folder$ ls -arlt 
total 8 
---------- 1 bin bin  0 Tem 28 14:30 test1