Skip to content
Primary Menu
  • Officetricks.Com
  • Blog
  • App Store
    • International Users
    • Indian Users
  • Subscribe
  • About Us
  • Excel
  • Social Media

How to Find Current Username – in DOS, Linux & Mac OS?

May 13, 2025
Kumarapush

Dos Command for Current logged in Username

This article gives the the CLI (command line interface) function for finding current logged in username in different operating systems.

To our surprise, it is the same command in all these OS – Windows DOS, Linux & Mac OS. 

Follow these steps in Windows PC. 

  1. Press Windows Key + R.
  2. Type ‘cmd’. 
  3. Press Enter. 

In the dos prompt, try this command. 


whoami

This command displays the current username.

Similarly you can try this in a Unix or Mac OS environment as well.

Similar to this command, it would be fascinating, if all the different OS developers/founders have designed common functionalities with same name across all platforms.

How easy it would be for the programmers?

Note:

  • MacOS recently changed the functionality to ‘id – un’.
  • In DOS, you can also use to retreive it from environment variable like ‘echo %username%’
Tagged in : dos linux login login username macos username whoami Windows login windows username

Related Articles

Excel VBA Timer Event – Run Macro at Specific Time – Automatic Schedule

Free Windows 10 to Windows 11 Upgrade – Preview version

Outlook Archive Email – Move Email To PST – VBA Macro

Post navigation

Previous Previous post: How to open VBA in Excel – Macro code editor?
Next Next post: Turn on Windows 10 Taskbar Search Box – Quick Shortcut
Cmd Prompt Login Accounts/Username System Control
Cmd Prompt Tricks
  • List available Wifi Networks & change Connection
  • Shell Script
Login Accounts/Username Tricks
  • Excel VBA Get Username – in 6 Easy ways – using Macro
  • Excel VBA – Get Extended File Property – Author Modified Date Time
  • Fiverr Disabled – Issues with Freelancer Sites – My Experiences
  • List all windows UserNames & Domain in VBA
  • How to get username in Python?
System Control Tricks
  • Best Android Backup App in Play Store
  • Enable Dark Mode in Windows 10
  • How to use Excel VBA Telnet To Autorun Commands?
  • Create ListView in VBA at Runtime
  • VBA File Open Dialog Box
  • Creating Folders Using Python: A Simple Guide
  • A Simple Guide to Copying Excel Sheets
  • Retrieve All Files in a Directory using Python
  • Creating Folders in Outlook: A Guide
  • Chandrayaan 3 Live Stream Today – Vikram Lander
  • Creating Folders Using Python: A Simple Guide
    As the world of technology continues to advance, it becomes evident that the ability to manipulate, create, and manage digital spaces is of utmost importance. Python programming language is among the most powerful tools capable of such feats. This exciting exploration commences with an introduction to Python, providing essential knowledge […]
  • A Simple Guide to Copying Excel Sheets
    Navigating the intricate landscape of Microsoft Excel can often seem like a daunting task. This software, with its abundance of features, functions, and commands, requires a keen understanding to fully utilize its potential. Whether you’re an industry expert or a novice user, mastering the art of manipulating Excel sheets is […]
  • Retrieve All Files in a Directory using Python
    In our digitally driven world, where data processing and management are integral to many industries, the ability to work with Python has become an invaluable skill. This language, particularly in relation to file and directory manipulation, grapples with the rapid growth of data and its intricate handling. With its intuitive […]
  • Officetricks.Com
  • Blog
  • App Store
    • International Users
    • Indian Users
  • Subscribe
  • About Us
  • Excel
  • Social Media
Copyright All rights reserved