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 12, 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

VBA to Delete File in a Folder

How to get Computer MAC Address using Excel VBA?

Trace Lost Phone – Even Without Internet – Using SMS

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
  • How to get username in Python?
  • Excel VBA Get Username – in 6 Easy ways – using Macro
  • List all Excel VBA Environment Variables – Username
  • Excel VBA – Get Extended File Property – Author Modified Date Time
  • List all windows UserNames & Domain in VBA
System Control Tricks
  • Outlook Archive Email – Move Email To PST – VBA Macro
  • Best Android Security App for Smartphones and Android Devices
  • How to find your VBA Version – V6 or V7?
  • Trace Lost Phone – Even Without Internet – Using SMS
  • WhatsApp Activate Voice Call Feature
  • 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
x