Basic Linux commands
Posted
By Vinoth
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
To add a group to directory
sudo chgrp -R username directoryname
To make directory read write access to group
sudo chmod g+rwx -R directoryname