Basic Linux commands


To list all the users in system.

cat /etc/passwd

To list all the groups in system.

cat /etc/group

To add new user.

sudo adduser username

To add a user to sudo group.

sudo usermod -aG sudo username

To delete user.

sudo deluser username

To delete user and his home directory

sudo deluser --remove-home username

Leave a Reply

Your email address will not be published.