Skip to content
  • About
  • Courses
  • ResearchExpand
    • Research Publications
    • Books
    • Patents
    • Ph.D. Supervised
  • Workshop/Conferences
  • ToolsExpand
    • Creative Image Converter
    • Creative QRCode Generator
    • Creative QR Code Generator Tool
    • EMI Calculator
    • SIP Calculator
  • Blog
  • Resume
One Page CV

User Management Commands in Linux

CommandPurposeKey OptionsExample
useraddAdd a new user to the system-m (create home dir), -G group (assign to group), -s shell (set default shell)sudo useradd -m -G developers -s /bin/bash john
usermodModify an existing user account-aG group (add to group), -s shell (change shell), -l login (change username)sudo usermod -aG sudo john
passwdChange a user’s password--stdin (provide password through stdin)sudo passwd john
userdelDelete a user account-r (remove home directory)sudo userdel -r john
chageSet or display password aging for a user-l (list info), -M days (maximum days between password changes)sudo chage -M 90 john
whoShow who is logged into the systemNonewho
wShow who is logged in and what they are doingNonew
idDisplay user ID, group ID, and other group membershipsNoneid john
groupsShow the groups a user belongs toNonegroups john
fingerDisplay information about a userNonefinger john
suSwitch to another user- (start login shell), -c command (run command as another user)su - john or su -c "whoami"
sudoExecute a command as another user or as root-u user (run as another user), -i (run as login shell)sudo -u john -i or sudo ls /root
lastShow listing of last logged-in usersNonelast john
lastlogReport the most recent login of all users-u user (check specific user)lastlog -u john
whoamiDisplay the current logged-in user’s usernameNonewhoami
adduserAdd a user (alternative to useradd, simpler UI)Nonesudo adduser john
deluserDelete a user (alternative to userdel)Nonesudo deluser john

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Nishant Munjal

Coding Humanity’s Future </>


Facebook Twitter Linkedin YouTube Github Email

Tools

  • SIP Calculator
  • EMI Calculator
  • Creative QR Code
  • Image Converter

Resources

  • Blog
  • Contact
  • Refund and Returns

Legal

  • Disclaimer
  • Privacy Policy
  • Terms and Conditions

© 2025 - All Rights Reserved

  • About
  • Courses
  • Research
    • Research Publications
    • Books
    • Patents
    • Ph.D. Supervised
  • Workshop/Conferences
  • Tools
    • Creative Image Converter
    • Creative QRCode Generator
    • Creative QR Code Generator Tool
    • EMI Calculator
    • SIP Calculator
  • Blog
  • Resume
Download CV
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.