What will this terminal command do?

Discussion in 'Mac Apps and Mac App Store' started by dogbone, Apr 8, 2006.

  1. dogbone macrumors 68020

    dogbone

    Joined:
    Sep 16, 2005
    Location:
    S33.687308617200465 E150.31341791152954
    #1
    sudo chown -R 'id -u'

    If I enter the above code exactly as is including the single quotes in Terminal and then drag my Application folder into terminal and execute, what will happen.
     
  2. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #2
    Read the man page?

    http://www.hmug.org/man/8/chown.php

    AFAIK, 'id -u' is not a flag that chown understands. My guess is that it will complain about syntax.

    However, "id -u" will give the numerical UID of the current user.. I don't know if it would be called correctly from inside chown but it did.. this command would change the ownership of the application to the UID of whomever is the current user.

    EDIT: I was right.. 'id -u' is an invalid argument.

    Code:
    sudo chown -R 'id -u' /Users/yellow/Desktop/BooBoo.app
    chown: id -u: Invalid argument
    
    Perhaps this person wanted you to do id -u in the Terminal FIRST, and then substitute that numerical UID for the 'id -u' portion.. which is how the syntax should go when using chown.
     
  3. dogbone thread starter macrumors 68020

    dogbone

    Joined:
    Sep 16, 2005
    Location:
    S33.687308617200465 E150.31341791152954
    #3
    Thanks for the quick reply.

    I've already been through the experience of trashing my system folder by a syntax error. Which is why I'm going to be absolutely sure this time before I do anything.:)

    I'll have a look at that link it looks like it might do the trick. When I work out the correct code I'll confirm it first here to make sure I've got it right.

    My gf has inherited my old computer and I've deleted all traces of me from the system but all the apps I installed have wacky permissions and ownership.

    My goal is to change everything inside the Application folder to be owned by the proper owner of the computer and the group to be Admin, and all the permissions to be rwxrwxr--, then to run a repair permissions to change all the System apps back to their default values. I was given the above code but I'm not sure about it yet.

    EDIT:, Just looked at the link and I'm not going to be able to work out the terminal commands on my own.
     
  4. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #4
    Oh.. if you know your girlfriend's short username, just do:

    sudo chown -R shortusername /Applications/

    sudo chmod -R ugo+wrX /Applications


    Repair permissions to fix any apps that require particular permissions.
     
  5. dogbone thread starter macrumors 68020

    dogbone

    Joined:
    Sep 16, 2005
    Location:
    S33.687308617200465 E150.31341791152954
    #5
    Fantastic. worked like a charm. I really appreciate you answering this.
     

Share This Page