What other user-related commands exist?

QuestionsQuestions8 SkillsProDec, 12 2025
0113

That's a great question! It shows you're thinking beyond the current step.

Besides whoami, here are a few other common user-related commands that are very useful in Linux:

  1. id: This command displays detailed information about the current user (or a specified user), including their user ID (UID), group ID (GID), and all the groups they belong to.

    • Example: id
    • Output: uid=1000(labex) gid=1000(labex) groups=1000(labex),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),116(lpadmin),126(sambashare) (Your output might vary slightly)
  2. who: This command shows who is currently logged on to the system. It can display username, terminal line, login time, and more.

    • Example: who
    • Output: labex tty1 2024-07-30 08:30 (:0) (Shows current login sessions)
  3. w: Similar to who, this command shows who is logged on and what they are doing. It includes load average information as well.

    • Example: w
  4. users: This is a simpler command that just lists the usernames of the users currently logged in.

    • Example: users
    • Output: labex
  5. passwd: This command is used to change a user's password. If run without arguments, it changes the password for the current user.

    • Example: passwd (It will then prompt you to enter the current password, then the new password twice)

These commands provide different perspectives on user information and activity on a Linux system.

Do any of these seem particularly interesting to you, or would you like to explore how they work?

0 Comments

no data
Be the first to share your comment!