Mac terminal list logged in users

terminal - Find logged on user and network home directory with a bash script - Ask Different

I am using OS X Yosemite I haven't tested it with other Mac operating systems. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service , privacy policy and cookie policy , and that your continued use of the website is subject to these policies. Home Questions Tags Users Unanswered. Ask Question. JakeGould See man last. Spiff Spiff This answer is correct and might show info, however if an attacker had physical access to an unlocked machine they can easily remove any evidence of their access.

List User Accounts on Mac from Command Line

If you are concerned about such access you need to enable full disk encryption and always lock your screen. It is not about hardening a system or preventing access.

To do that, cut and paste the following into Terminal:. The 1 0 is the old value hidden followed by the new value unhidden. For the more advanced We can save ourselves some typing by putting much of this into a script so that we can run it whenever we want.

  • How to See What Users Are Connected & Logged In To a Mac?
  • mac file system windows 10?
  • free screencasting apps for mac!

To save on the typing, you can copy the whole script from my pastebin here. Bookmark the permalink. Skip to navigation Skip to main content Skip to primary sidebar Skip to secondary sidebar Skip to footer.

  1. About philastokes;
  2. List User Accounts on Mac from Command Line.
  3. ms office for mac download crack.
  4. How to List All User Accounts on a Mac from Command Line.
  5. Your Answer.
  6. windows photo viewer alternative for mac.
  7. how to reveal hidden users.
  8. First, we can use the dscl utility to list all users, and you might be surprised at how many there are: Try this dscl. To see specifically if any accounts are hidden, we need a longer command: Because if there were it would return something very different, like this: To do that, cut and paste the following into Terminal: Next, we need to change the IsHidden key in dscl for that user, so sudo dscl.

    Like this: You don't have to write any script to get them.

    All replies

    Hai Vu Hai Vu 4 This will only tell me the username and home of the user that runs the script. I want the user that is logged on to the GUI, the script is running as a different user. I see.

    25 Terminal Commands For Beginners/ Programmers/ Mac OS X Users

    I misunderstood the question. Now I am using: Assuming logname works, then you can get the home directory like this: I updated the question. Not sure if all the other complications are needed.