logname

display user name 

Command


SYNOPSIS

logname


DESCRIPTION

logname displays the login name of the person who issues the command.

Windows use the GetUserName() function to determine the user login name. On 10/2016/2019/11/2022/2025 the name of the account that was logged into the computer is displayed.


DIAGNOSTICS

Possible exit status values are:

0 

Successful completion.

1 

logname could not determine the login name.


PORTABILITY

POSIX.2. x/OPEN Portability Guide 4.0. UNIX System V. Windows 10. Windows Server 2016. Windows Server 2019. Windows 11. Windows Server 2022. Windows Server 2025.


AVAILABILITY

PTC MKS Toolkit for Power Users
PTC MKS Toolkit for System Administrators
PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Commands:
env, id

Miscellaneous:
envvar


PTC MKS Toolkit 10.5 Documentation Build 40.