logname

Print current login name

SYNTAX
      logname

Prints the calling user’s name, as found in the file`/var/run/utmp', and exits with a status of 0.

If there is no `/var/run/utmp' entry for the calling process, `logname' prints an error message and exits with a status of 1.

The only options are `--help' and `--version'.

“What passes for identity in America is a series of myths about one’s heroic ancestors” ~ James Baldwin

Related macOS commands

hostname - Print or set system name.
id - Print user and group id’s.
w - Show who is logged on and what they are doing.
uname - Print the Darwin OS Kernel version / release / machine name.
users - Print login names of users currently logged in.
who - Print who is currently logged in.
Equivalent Windows command: ECHO %username%


 
Copyright © 1999-2024 SS64.com
Some rights reserved