Linux logname command

Updated: 05/04/2019 by Computer Hope
logname command

On Unix-like operating systems, the logname command prints the login name of the current user.

This page covers the GNU/Linux version of logname.

Syntax

logname [OPTION]

Options

--help Display a help message, and exit.
--version Display version information and exit.

Examples

logname

Returns the name of the currently logged in user.

env — Report the value of environment variables.
login — Begin a session on a system.