How do I get the name of the active user via the command line in OS X?

前端 未结 12 1541
耶瑟儿~
耶瑟儿~ 2020-12-13 05:27

How do I get the name of the active user via the command line in OS X?

12条回答
  •  醉梦人生
    2020-12-13 05:54

    If you'd like to display the full name (instead of the username), add the -F flag:

    $ id -F
    Andrew Havens
    

提交回复
热议问题