Skip to content

Poop Code

  • Home
  • Linux

Get current user in shell

October 18, 2024 by poopcode

Using a built-in variable:

$ echo $USER
anand

Using a command:

$ whoami
anand

Categories Linux
Get home directory of logged in user in Shell
Get the number of processors in Linux and MacOS
© 2025 Poop Code • Built with GeneratePress