MintGuide.org / How to know current user in Linux Mint?

How to know current user in Linux Mint?

The easiest way to obtain the current user is to run the following command:

whoami

Also, you can use environment variables and display the following option:
echo $USER

Also, you can retrieve a user by ID:
id -u -n

Also, you can get user's PID:
ps -o user= -p $$ | awk '{print $1}'

Good Luck!!!

19-05-2016, 12:00
Go Back