Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Display current login user information

Answer:

To check your Linux username, use whoami

$ whoami

john

To see your User ID (UID), Group ID (GID) and who groups you belong to, use the command id

$ id

uid=1000(john) gid=100(users) groups=33(www-data),100(users)
  1. Show the current user in MySQL
  2. Find the current user UID and GID
  3. How to change the login shell?
  4. Execute command as another user
  5. Find files by owner

One Response to “Display current login user information”

  1. [...] in the shell, we can execute the command whoami to find out the current user name, we can use the function [...]

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>