Linux command
logname 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Print login name
logname
说明
logname prints the user's login name. It reads from the utmp file to determine the original login. Unlike whoami, logname shows the login name even after su or sudo commands.
参数
- --help
- Display help information.
- --version
- Display version information.
FAQ
What is the logname command used for?
logname prints the user's login name. It reads from the utmp file to determine the original login. Unlike whoami, logname shows the login name even after su or sudo commands.
How do I run a basic logname example?
Run `logname` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --help do in logname?
Display help information.