“This is the 22nd day of my participation in the August Gwen Challenge.

The vast sea of millions, thank you for this second you see here. Hope my article is helpful to you!

May you keep your love and go to the mountains and seas in the coming days!

Linux advanced commands

Yesterday we have finished learning some basic commands of Linux, next we are going to enter a new stage, for Linux advanced command learning!!

Today we will focus on some administrative commands for users in Linux.

Linux user management

  1. Linux is a multi-user and multi-task operating system. Any user who wants to use system resources must apply for an account from the system administrator and use the account to access the system
  2. Linux users need to belong to at least one group.
  3. Root is the super administrator.

Add user

Command:

Useradd [option] User name: Creates a user

Password User name: Specifies a password for the user name

Parameter details:

  • -d: Specifies the home directory for the newly created user.

Specific demonstration:

Delete user

Command:

Userdel [option] User name: Deletes a user

Parameter details:

  • -r: Deletes a user and deletes the user’s home directory

Specific demonstration:

Querying User Information

Command:

Id User name: Queries user information

Specific demonstration:

Switch the user

On Linux, you can run the su- command to switch to a user with high permission, such as root, if the current user has insufficient permission.

Command:

Su – User name: switch the user

Specific demonstration:

Note:

  1. You do not need to enter a password to switch from a user with a higher permission to a user with a lower permission.
  2. When you need to return to the original user, use the exit directive

The set of operations

Command:

Groupadd User group: Adds a group

Groupdel User group: Deletes a group

Useradd -g User group User name: The user group is added when a user is added

Usermod -g User group User name: Changes the user group

Specific demonstration:

conclusion

I believe that you are on the Linux system user management related commands have a certain understanding, looking forward to waiting for the next chapter in Linux advanced command file permissions management learning bar!

Of course, there are more commands to watch next time! Welcome to the next chapter!

Let’s refuel together, too! I am not just, if there is any missing, wrong place, also welcome you to criticize in the comments of talent leaders! Of course, if this article is sure to help you a little, please kindly and lovely talent leaders to give a thumb-up, favorites, one key three even, thank you very much!

Here, the world is closed for today, good night! Although this article is over, I am still here, never finished. I will try to keep writing articles. The coming days are long, why fear the car yao ma slow!

Thank you all for seeing this! May you live up to your youth and have no regrets!