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 linux commands:

groups – Print group names a user is in.
hostname – Print or set system name.
id – Print user and group id’s.
uname – Print system information.
users – Print login names of users currently logged in.
who – Print who is currently logged in.
Equivalent Windows command: ECHO %username%

Te ayudó?