Commande Linux chgrp


  Résultats de traduction:

Nom du fichier

Commande Linux chgrpsyntaxe

Fonction : La commande chgrp permet de changer le groupe auquel appartient un fichier ou un répertoire.

Syntaxe : chgrp [-cfhRv][--help][--version][group][fichier ou répertoire...] ou chgrp [-cfhRv][--help][--reference= < Fichier ou répertoire de référence>][--version][Fichier ou répertoire...]

Commande Linux chgrpexemple

Exemple 1 : Modifiez l'attribut de groupe du fichier :

chgrp -v bin log2012.log

Sortie :

[root@localhost test]# ll---xrw-r-- 1 root root 302108 11-13 06:03 log2012.log[root@localhost test]# chgrp -v bin log2012.log

Le groupe auquel appartient "log2012.log" a été remplacé par bin

[root@localhost test]# ll---xrw-r-- 1 root bin  302108 11-13 06:03 log2012.log

Instructions : Modifiez le fichier log2012.log à partir du groupe racine au groupe bin

Exemple 2 : modifiez l'attribut de groupe du fichier en fonction du fichier spécifié

chgrp --reference=log2012.log log2013.log

Sortie :

[root@localhost test]# ll---xrw-r-- 1 root bin  302108 11-13 06:03 log2012.log-rw-r--r-- 1 root root     61 11-13 06:03 log2013.log[root@localhost test]#  chgrp --reference=log2012.log log2013.log 
[root@localhost test]# ll---xrw-r-- 1 root bin  302108 11-13 06:03 log2012.log-rw-r--r-- 1 root bin      61 11-13 06:03 log2013.log

Recommandations populaires

Maison

vidéos

Questions et réponses