Active 2 years, 8 months ago. Viewed k times. The title says it all. Braiam There are a couple of ways: Using the id command you can get the real and effective user and group IDs. Using the enviroment variable. How about GID? The username is optional, defaulting to yourself. Maybe square brackets would be better for indicating this, instead of angle brackets. TAq TAq 4 4 silver badges 4 4 bronze badges. Prefer Jobin's answer, if you need to avoid parsing the output. Try also : getent passwd username This will display user id , group id and home directory.
You can use id command. Diego Lopez Diego Lopez 3 3 bronze badges.
Owners and groups in the Finder and command line
Sign up or log in Sign up using Google. Sign up using Facebook. Thanks again! Anonymous says: Feb 02, PM. I'm glad it helped. You are absolutely right, Aaron. I've updated the guide. Thanks for your hint! Anonymous says: Jan 26, AM.
I used sudo rather than root for this process. With sudo, it appeared impossible to enter some directories where there was a file needing renaming. In this case, do a "sudo mv" but you'll have to put the directory name in as well. That seemed to work. In the case of launchd. A useful guide - thanks! Personally, as an old Linux guy I prefer working as root.
But for this guide I think it's best to use the root user over the sudo approach because using sudo implies that you work as a different non-privileged user what may but doesn't necessarily have to be the case. Using the root user, you don't run into the mentioned problems entering folders that you don't have access to. In the end, using sudo or the root user is mostly just a matter of preference. It turned out that there were too many files and folders which carried in their names without being related to the uid anyhow but only a few to none I don't remember relevant ones that should have been renamed.
So I did it exactly as you suggest. I've updated the how-to accordingly. Thanks for your hint, Tim! Great discussion guys. I didn't mention it earlier, but I used sudo for this entire process as well. Also, with sudo, there's no chance I'll forget to disable root when I'm done.
I think Roman's exactly correct. It's usually a matter of personal preference.
Anonymous says: Feb 03, AM. Yet another sudo discussion? But sometimes I tend to use the root account, especially when I have to use lots of admin commands - or write some how-to that should be easy to use. Another option, of course, is to use "sudo -s" or "sudo -i". This will turn your shell into a "root shell" so you don't need to enable the root user or hack in "sudo" again and again which can be quite annoying. Anonymous says: May 04, AM. What modifications are needed for I have tested the above info in Snow, however I have a few users in I'm sorry but I can't test that because I don't have a machine running Tiger any more.
Anonymous says: Sep 02, PM. Excellent article, thanks! I just used this on Just wanted to say thanks! The procedure worked just as described. The only thing I'd add is to reboot after all the chown-ing and mv-ing is done. I logged into one of the affected accounts immediately after moving everything around and everything was wonky no Desktop, no Finder, etc. I'm guessing some processes got confused by the changed UIDs and needed a fresh start.
Thanks for this, very handy. One thing to add is the chown call should be chown -h or if you have any symlinks then they end up beloning to the old userid. I also changed the gid PrimaryGroupID to match and did the same thing for the chgrp call.
Anonymous says: Oct 31, AM. For some reason, chown wasn't in my path and couldn't find it since the locatedb wasn't properly loaded. Took me a while to find it but wanted to make sure others could find it easily.
Adding it to delicious now! Anonymous says: Nov 03, PM. Hi all, Anyone can help me with this? Anonymous says: Nov 18, AM. This one might be a little more complete. Also changes owner of symbolic links.
macos - Switch user MAC terminal - Stack Overflow
Also uses xargs to execute the chown command as few times as possible. Note I just did this on Lion. Roman says: May 23, PM. Finally, I've updated the guide according to your hint. Thank you! Anonymous says: Jan 04, PM. It's very important to use "chown -h" instead of "chown". The link target may have a completely different uid.
Right, I've changed the commands. Anonymous says: Jan 21, PM. After a restart it also changed automatically the ownership of the user's files? Or would this only change the user-id and nothing more? Thanks for any hints ….
- how to install sphax texture pack for tekkit mac.
- canon eos shutter count mac.
- macos - Switch user MAC terminal - Stack Overflow.
- Then rename the account?
- how to see my iphone texts on my mac;
I doubt that this will work, but I haven't checked. Feel free to try and report back :. Anonymous says: Feb 11, AM. No, it's not sufficient. Anonymous says: Oct 03, AM. No problems here, but of course you should have an clone or a backup of your system and user stuff. This is a great manual! Since I wanted to have my System and Accounts on the SSD, but the working files "data" on the old drive, this was a real pain. I didn't want to get rid of all user stuff on the old drive either, to have a fallback in case there were issues with the new SSD.
At least for the main issues I'm now really happy. Anonymous says: Apr 06, PM. I have done this on SL, but now find that the user wont show up in the login window. I can manually type in my user name in the login window and that works. Anyone have an idea why this is? Alexey says: Aug 29, PM.