Si tu fais :
 chown -R utilisateur.groupe /répertoire/.*

tu vas changer récursivement : 
        /répertoire/.
        /répertoire/..
        /répertoire/../*

C'est pas ça que tu veux, je suis sur et certain.

Si tu lis bien la doc, tu verras que tu peux faire ceci ;
cd /home
su  (si tu n'est pas déjà root)
chown -R user:goup répertoire 
exemple :
[root@denisb home]# chown -R raphael:raphael renaud
[root@denisb home]# ls -la renaud
total 40
drwxr-xr-x    4 raphael  raphael      4096 déc  6 17:03 .
drwxr-xr-x    8 root     root         4096 déc  5 20:54 ..
-rw-r--r--    1 raphael  raphael        24 nov 11 03:06 .bash_logout
-rw-r--r--    1 raphael  raphael       191 nov 11 03:06 .bash_profile
-rw-r--r--    1 raphael  raphael       124 nov 11 03:06 .bashrc
-rw-r--r--    1 raphael  raphael       820 déc  6 17:03 .emacs
drwxr-xr-x    3 raphael  raphael      4096 déc  6 17:03 .kde
-rw-r--r--    1 raphael  raphael       141 nov 11 03:06 .mailcap
-rw-r--r--    1 raphael  raphael      3511 nov 11 03:06 .screenrc
drwx------    2 raphael  raphael      4096 nov 11 03:06 tmp
[root@denisb home]# chown -R renaud:renaud renaud
[root@denisb home]# ls -la renaud
total 40
drwxr-xr-x    4 renaud   renaud       4096 déc  6 17:03 .
drwxr-xr-x    8 root     root         4096 déc  5 20:54 ..
-rw-r--r--    1 renaud   renaud         24 nov 11 03:06 .bash_logout
-rw-r--r--    1 renaud   renaud        191 nov 11 03:06 .bash_profile
-rw-r--r--    1 renaud   renaud        124 nov 11 03:06 .bashrc
-rw-r--r--    1 renaud   renaud        820 déc  6 17:03 .emacs
drwxr-xr-x    3 renaud   renaud       4096 déc  6 17:03 .kde
-rw-r--r--    1 renaud   renaud        141 nov 11 03:06 .mailcap
-rw-r--r--    1 renaud   renaud       3511 nov 11 03:06 .screenrc
drwx------    2 renaud   renaud       4096 nov 11 03:06 tmp
-fin de l'example
Pourquoi :
man chown
(...)
      -R     Modifier  récursivement  l'appartenance  des réper­
              toires et de leurs contenus.
(...)
donc, si tu fais :
chown -R a:a rep/.* (et bien ça inclut rep/..)
et si tu fais :
chown -R a:a rep (et ça exclut rep/.. mais inclut -f .*)
(-f :  -f fichier Vrai  si  le fichier existe et est un fichier régulier. ie 
man bash )

-Denis


Le 6 Décembre 2001 21:17, cc a écrit :
> Le Jeudi  6 Décembre 2001 13:38, vous avez écrit :
> > Essaye :
> > chown -R utilisateur.groupe /répertoire/.*
> > Rosaire
> >
> > cc a écrit :
> > > Le Jeudi  6 Décembre 2001 14:21, vous avez écrit :
> > > > Salut,
> > > > quelqu'un saurait-il comment changer le propriétaire d'un répertoire
> > > > et de ses sous-répertoires, y compris les fichiers cachés (commençant
> > > > par un point), en ligne de commande.
> > >
> > > Merci à Hervé, Thomas, Mohamadi et Patrick.
> > > Mais j'ai toujours le même problême : les fichiers cachés (dont le nom
> > > commence par un point) du répertoire courant conservent leur
> > > propriétaire antérieur (avec chown -R groupe.utilisateur *). Y a t'il
> > > un truc que j'ai manqué (j'ai eu beau lire la man page, je n'ai rien
> > > trouvé qui explique cela et c'est pour ça que j'avais posté !)
>
> Quand je fais ça, il me change le propriétaire du répertoire parent !
> Explications : à la suite d'un problème sur ma partition /home, j'ai copié
> (sous root) son contenu dans une autre partition. Après avoir réparé ma
> partition, j'ai recopié ma "sauvegarde", toujours loggé en root.
> Bien sûr, tous mes fichiers se sont retrouvés propiété de root.
> J'ai donc fait un "chown -R utilisateur.groupe /home/utilisateur/*
> Les fichiers de /home/utilisateur cachés étaient réstés propriété de root.
> J'ai donc essayé "chown -R utilisateur.groupe /home/utilisateur/.*"
> Et là tous mes fichiers de /home avaient changé de propriétaire !
> Je n'ai rien trouvé après avoir RTFM !
> Help !
> CC

Vous souhaitez acquerir votre Pack ou des Services MandrakeSoft?
Rendez-vous sur "http://www.mandrakestore.com";

Reply via email to