LOGNAME(1POSIX)
πΈ PROLOG πΈ
okay bestie, real talk before we even start: this page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (so like, go check the corresponding Linux manual page for the deets on Linux behavior), or honestly the interface might not even be implemented on Linux at all. π
β¨ NAME β¨
logname β returns the user's login name π«Ά
π SYNOPSIS π
logname
that's it. that's the whole thing. no flags, no arguments, she's a minimalist. π
π DESCRIPTION π
so logname writes the user's login name to standard output. simple as that. the login name is the string that the getlogin() function would return β you know, the one defined in the System Interfaces volume of POSIX.1β2017. β¨
and under the conditions where getlogin() would fail? yeah, that's when logname writes a diagnostic message to standard error and exits with a non-zero exit status. no cap, it will let you know something went wrong. π
π OPTIONS π
None. not a single one. she doesn't need them. π
π¦ OPERANDS π¦
None. zero. nada. πΈ
β STDIN β
Not used. she's not reading anything from you, bestie. π
π INPUT FILES π
None. π
π§ ENVIRONMENT VARIABLES π§
the following environment variables shall affect the execution of logname:
LANGβ provides a default value for the internationalization variables that are unset or null. (peep the Base Definitions volume of POSIX.1β2017, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) πLC_ALLβ if it's set to a non-empty string value, it overrides the values of all the other internationalization variables. she's the main character fr fr. πLC_CTYPEβ determines the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments).LC_MESSAGESβ determines the locale that should be used to affect the format and contents of diagnostic messages written to standard error.NLSPATHβ determines the location of message catalogs for the processing ofLC_MESSAGES.
π₯ ASYNCHRONOUS EVENTS π₯
Default. π
π©· STDOUT π©·
the logname utility output shall be a single line consisting of the user's login name:
"%s\n", <login name>
one line, one name, iconic behavior honestly. β¨
π STDERR π
standard error shall be used only for diagnostic messages. that's her one job. π«Ά
πΈ OUTPUT FILES πΈ
None. π
π EXTENDED DESCRIPTION π
None. π¦
π EXIT STATUS π
the following exit values shall be returned:
0β successful completion. slay! π>0β an error occurred. π
π CONSEQUENCES OF ERRORS π
Default. π«Ά
the following sections are informative. (aka, the fun bonus lore β read them, they're cute.)
π APPLICATION USAGE π
the logname utility explicitly ignores the LOGNAME environment variable because environment changes could produce erroneous results. so don't come at her with your LOGNAME, she's not listening. π
βοΈ
π EXAMPLES π
None. π
β RATIONALE β
the passwd file is not listed as required because the implementation may have other means of mapping login names. iykyk. π«
π§ FUTURE DIRECTIONS π§
None. π
π SEE ALSO π
id, who
the Base Definitions volume of POSIX.1β2017, Chapter 8, Environment Variables
the System Interfaces volume of POSIX.1β2017, getlogin()
π COPYRIGHT π
portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
that's the whole page bestie, you ate it up π go run logname and find out who you are (digitally).
this has been your girl bringing you the IEEE/The Open Group 2017 edition of LOGNAME(1POSIX) β stay iconic, stay POSIX-compliant β¨π¦π
π¦ where this page comes from
- debian bookworm: manpages-posix 2017a-2 Β· Other
- debian trixie: manpages-posix 2017a-2 Β· Other
- ubuntu jammy: manpages-posix 2017a-2 Β· Other
- ubuntu noble: manpages-posix 2017a-2 Β· Other
- ubuntu resolute: manpages-posix 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms