-1

I need to chmod ugo-rw 12 different gif and jpg files so the python terminal can access them do I HAVE TO do that for each individual one? Is it possible to grant rw permissions to multiple files at once?

  • While we're at it, `ugo-rw` will _remove_ rw permissions, not add them; you want `ugo+rw`. Or, more simply `a+rw`. You may want to read the manpage for `chmod`. (And if you had, it would have immediately shown that you can pass it as many files as you want, too.) – abarnert Feb 27 '13 at 01:31

1 Answers1

0

You can do them all at once by providing all of the files as additional arguments to chmod after the options, for example:

chmod ugo+rw file1 file2 file3 file4 ...
Andrew Clark
  • 202,379
  • 35
  • 273
  • 306
  • Shell expansion works, also: `chmod ugo+rw *.gif *.jpg`. – Robᵩ Feb 27 '13 at 01:22
  • Of course under the covers, this is still calling `chmod(2)` on each of the 12 files individually, not actually granting permissions to all of them at once. But I'm guessing this is what the OP actually wants. – abarnert Feb 27 '13 at 01:30