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"