What does ‘whoami’ command return?

Configurare noua (How To)

Situatie

There are situations where you would like to “crosscheck” the username of the current user (connected), for example before running a specific command (of a specific user only).

Solutie

For this you can use the command ‘whoami’ (available on both Unix/Linux and Windows platforms).
for example:

-- For Unix/Linux
--- snip ---
oracle@fsihost074:$ whoami
oracle
--- snip ---
-- For Windows :
--- snip ---
C:\Users\cuser>whoami
cuser-ro\cuser
--- snip ---

Another similar output can be returned on Unix/Linux by “id” command, as:

-- For Unix/Linux
--- snip ---
oracle@fsihost074:$ id -un
oracle
--- snip ---

Tip solutie

Permanent

Voteaza

(9 din 11 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?