Basic commands used on linux terminal part 5
- Useradd – this is known as users add. Alternative command is adduser. This command is used for creating new users. it have different parameters for simple to advance level use. Using this command we can create a user without any leveling, also we can create it with several leveling like home directory, shell access, comments against the user, set uid, set gid etc.
example: useradd [option] username
- Userdel – this command is known as user delete. It does not have any alternative command. This command is simply used to delete a user. We can delete this user with or without its properties. If we do not delete its properties then we cannot create another user with the same username. So this is the best practice to delete a user with every property it had.
example: userdel [option] username
- Usermod – this command is known as user modification. Using this command we can modify the property a user had. A very useful command for account maintenance. It has different parameters to modify different property of a user. The only mandatory issue to use this command is, the user have to existing user of the system.
example: usermod [option] username
- Groupadd – this command is used for creating new groups. Simply this command will create a group either with given values or with default system values. Group creation is a very important issue in case of identification, so there are various parameters for this command. We can put them at the beginning.
example: groupadd [option] groupname
- Groupdel – this command used for deleting existing group. We can delete a group by force if it has members in it. But it is wise if we move the members from the group to another group and then delete it.
example: groupdel [option] groupname
- Groupmod – groupmod command used for group property modification. We can change the group id, group home directory, group permissions and others. So we have different issues to modify using this command. This whole thing depends on requirements.
example: groupmod [option] groupname
- Chage – this command is used for maintaining the user related properties like how long it will be active, how long the password will be useful, when the user have to change the password etc. this is a very important tool to maintain a certain level of security of the users.
example: chage [option] username
- Passwd – this command is all about password. We can use this command to set new password, also for reset password. This is a very commonly used command in linux.
example: passwd username
- Ps – ps stands for process status. It shows the running processes with its executing ID. This executing ID is known as PID or process ID. By using this command without any option with it can still show the process but in details. Also it have several parameters to get a summarized report about the processes that are running on the system.
example: ps [options]
- Last – this command used for auditing the login activities into a system. This command can show us the logged in users and also the users have logged in into this system within a time range. Also it can show us the duration of logged in time.
example: last [option]