whoami Linux Commands

What is Linux whoami Command?

Explanation

whoami COMMAND:

whoami command is used to print current user's login name along with effective userid.

SYNTAX :


whoami [options]

OPTIONS:


--help Display Help.
--version Display program version info

EXAMPLE:


Let us consider an example to print effective userid.
  1. whoami
    Output:
    root
  2. In the above example, the cmd prints the current user's userid as 'root'.

Ask Questions

Ask Question