Linux Commands Reference - Complete Linux Command Guide

Comprehensive Linux command reference with 150+ commands. Search, filter by category, and view detailed usage examples.

Share
Back to commands

logname

Show current login name

Syntax

logname [OPTION]...

Common Options

--versionShow version
--helpShow help

Common Examples

logname

Show login name

echo "Logged in as: $(logname)"

Use in script

logname vs whoami

Returns original user even with sudo

Related Commands

Related Tools

More Code & Dev Tools