Linux Whoami Command Tutorial To Find Current User
Linux provides different tools to identify current and related users.
whoami is one of the command that is used to display information about the current user.
Print Current User
We can print current user with
whoami command like below.
Use who am i
Another usage option of the
whoami command is using it separately. So we can simply write
who am i into the terminal like in English language and we will get detailed information about the current user like below.
$ who am i
I know it is not important but we can also print the version of the
whoami command with the
--version option like below.
Print Currently Logged In Users
We can also print currently logged in users into a Linux system with
w command. This command will also provide information like TTY ofthe user , Login time, idle and CPU usage too.
Omit The Header
While printing currently logged in users we can remove the header part ot the user list. We will use
$ w -h