Welcome To Golang By Example

Menu
  • Home
  • Blog
Menu

Know the current user on Linux

Posted on August 9, 2023August 9, 2023 by admin

Table of Contents

  • Overview

Overview

Linux command ‘whoami’ can be used to know the currently logged-in user.

Let’s see this command in action. Go to the terminal and type in the command

whoami

It will print the current user. Let’s say the current user is john then running the above command will simply print john

Output

whoami
john

Popular Articles

Golang Comprehensive Tutorial Series

All Design Patterns in Go (Golang)

Slice in golang

Variables in Go (Golang) – Complete Guide

OOP: Inheritance in GOLANG complete guide

Using Context Package in GO (Golang) – Complete Guide

All data types in Golang with examples

Understanding time and date in Go (Golang) – Complete Guide

©2025 Welcome To Golang By Example | Design: Web XP