Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Terminal.app to the rescue again' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Terminal.app to the rescue again
Authored by: lullabud on May 10, '05 11:25:22AM
In Terminal.app it would be very easy to set permissions on a lot of items. I've done it frequently, as I'm sure a lot of other unix guys have. For instance, find ~/Sites/ -type d -exec chmod a+rwx "{}" \; will give all of the folders in your personal web page the ability to be listed through a web browser. Similarly find ~/Public/ -type f exec chmod 644 "{}" \; will make all the files in your Public folder read-only to other users, but read-write to the file owner. sudo chown -R user:group ~/Public/ can be used to change ownership of all files in your Public folder, and of course any other folder can be substituted.

[ Reply to This | # ]
Terminal.app to the rescue again
Authored by: gidds on May 10, '05 05:52:22PM
Or it's even easier if you use zsh as your shell:

    chmod a+rwx ~/Sites/**/*(/)

The **/* lists files and folders recursively in all subfolders (in the same way that * lists those in the current folder), and the (/) restricts the results to folders. ( (.) would restrict to plain files, for example.)

I still don't understand why more people don't use zsh -- after all, it's not only free and open source, but it comes installed on every Mac!

---
Andy/

[ Reply to This | # ]

Terminal.app to the rescue again
Authored by: lar3ry on May 11, '05 02:32:43AM
Much more useful:
$ chmod a+rX ~/Sites
This makes all the files readable by everybody. In addition, things that are executable, including directories (!), are made executable by all. Using the lower case "x" in the command would make files executable, which is generally not wanted in the Sites folder...

[ Reply to This | # ]
Terminal.app to the rescue again
Authored by: lar3ry on May 11, '05 02:34:22AM
sigh... That should have been...
chmod -R a+rX ~/Sites


[ Reply to This | # ]