How to print current User name in the Linux

‘whoami ‘ command generally used to print user name associated with the current effective user ID. You can also find out user name with ‘id’ command with ‘ -un’ options.

[root@localhost ~]# whoami
root
[root@localhost ~]#

OR

[root@localhost ~]# id -un
root
[root@localhost ~]#

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s