Help! Need to change permissions for hundreds of files.

Discussion in 'Mac Basics and Help' started by natlinxz, Feb 22, 2010.

  1. natlinxz macrumors newbie

    Joined:
    Dec 10, 2009
    Location:
    Hey, don't be a pedophile!
    #1
    Okay, so I have been using my parents OS X login primarily for my computer life. I have made videos, played games, etc. using one account. But I decided to make my own account, and have had some success transferring files. However, the permissions are still set to the other account. So in iMovie, I can watch my videos but not edit them, since I have read-only permissions. I could easily go into finders "get info" menu and change permissions, but I have hundreds upon hundreds of imovie projects. So, how can I change the permissions of hundreds of files at a time? Editing the folders permission didn't work.
     
  2. NIPRING macrumors 6502

    Joined:
    Jan 19, 2008
    Location:
    Waukesha WI
    #2
    Try highlighting them all and then right click -> get info, then try and change permissions
     
  3. colinh macrumors newbie

    Joined:
    Feb 22, 2010
    #3
    Prepare to be amazed at the power of the command line! :)

    For this you need a Terminal (which resides in the /Applications/Utilities folder).

    There you can type:

    ls -al (that's two 'ell's, by the way)

    which will give you a long (detailed) listing of all the files and directories (aka folders) in your current directory.

    Then you can try:

    man chmod

    and

    man chown

    which will give you the manual pages for the commands change file mode (permissions) and change file ownership.

    You probably want to change the ownership rather than messing with groups or allowing read/write access to everyone.

    chown -R myname *

    will recursively change the ownership all files (and directories) in the current directory to myname. Recursively means that it'll then do the same in each directory and in each directory in those directories and ...


    Let me know if that's not clear.


    colin

    PS. oh, other useful commands are pwd for 'print working directory', cd [dir] for 'change directory [to dir] or your home directory', locate for finding things, less (which is like more, but better) and ...

    PPS. And if you want to know all commands available (and read the man pages for all of them) you can get them using the command completion feature: type a TAB TAB (ie. 'a' and then the TAB key twice). That will offer a list of all possible commands starting with 'a'. Then do the same with b to z :)

    ... pretty soon you'll be piping and grepping and will be a command line expert.
     
  4. natlinxz thread starter macrumors newbie

    Joined:
    Dec 10, 2009
    Location:
    Hey, don't be a pedophile!
    #4
    That was very helpful, thank you! It didn't work though. :(
    After doing the "chown -R username *" thing, It went through a long list of files, and kept saying "operation not permitted". NOOO!
     
  5. soup4you2 macrumors regular

    Joined:
    Apr 12, 2007
    #5
    If your account has administrator access do this.

    sudo chown -R username *

    This will execute the command with root/(administrator) rights.
     
  6. colinh macrumors newbie

    Joined:
    Feb 22, 2010
    #6
    Aaaah. OK.

    From the man page for chown:

    Rats!

    OK, so you would need to prefix that with a sudo like this:

    sudo chown -R username *

    (see man sudo)

    for which you need the password of an Administrator or root, depending on how your system is set up.

    sorry

    :mad:
     
  7. natlinxz thread starter macrumors newbie

    Joined:
    Dec 10, 2009
    Location:
    Hey, don't be a pedophile!
    #7
    Thank you everyone for your help, it has really been useful in making my new user account. However, I downloaded a program called BatChmod, which allows permissions to be changed on every file within a directory. I'm absolutely hopeless at using Terminal, so the interface in BatChmod helped me a lot.

    Thanks again!
     
  8. decksnap macrumors 68040

    decksnap

    Joined:
    Apr 11, 2003
    #8
    I was about to post the same thing. Works like a charm. While you're all here, ;) anybody know how to keep file permissions open or convert them when putting files to a server? I have to run BatChmod all the time on our server because people put stuff on it and the permissions lock other users out from using the files. Looking for a way to make it so when anything is copied to the server, the permission automatically become read/write for everyone.
     
  9. soup4you2 macrumors regular

    Joined:
    Apr 12, 2007
    #9
    you can either look into umask, acl, or using groups may be you're best and easiest option.

    http://osxfaq.com/Tutorials/LearningCenter/AdvancedUnix/ugp/index.ws
     

Share This Page