[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Set group seting to multiple files



also sprach Pierre Dupuis <pi.dupuis@wanadoo.fr> [2002.09.12.1319 +0200]:
> I expected a little problem, i have got a lot of files (Mp3s) organized 
> in rep with sub rep, and i want to set a exec authorisation for a user. 
> I know how to set it to a unique file, but there are more than one 
> thousand files, so i wanted to do for each Mp3s (and to sub dir too) in 
> only one command :)

assuming that your MP3s are in /music/mp3:

  chgrp -R music /music/mp3

    --> this recursively changes the group of the files to 'music'

  chown -R pierre /music/mp3

    --> this recursively changes the owner of the files to 'pierre'

  these two can be combined:

    chown -R pierre.music /music/mp3

  then you should make them accessible to all in group music:

    chmod -R o=rwX,g=rX,o= /music/mp3

and you are done.

one warning:

  NEVER, i repeat *N*E*V*E*R* use the -R flag to chmod/chgrp/chown if
  the final argument is not a directory. for instance

    chown -R pierre /music/mp3/*

  will eventually change *your entire filesystem* to be owned by
  pierre!

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:"; net@madduck
 
"when a woman marries again it is because she detested her first husband.
 when a man marries again it is because he adored his first wife.
 women try their luck; men risk theirs."
                                                        -- oscar wilde

Attachment: pgpBdXaVfGEOY.pgp
Description: PGP signature


Reply to: