useradd : it is used to add an user
Format: useradd [options] username
Eg: useradd –d /rock jack
Here it adds a user and the sets the users homedir as /rock
Eg2: useradd –L tom
Locks the user tom while creating user tom
Eg3: usermod –U tom
Here it unlocks the user tom which is created earlier.
Eg4:useradd –g linux tom
Here it sets linux as tom’s primary group
Eg5: usermod –G unix,manager tom
Here it sets unix and manager as tom’s secondary groups.
Eg6: usermod –s /sbin/nologin sam
Here it allots /sbin/nologin shell to user sam
