Linux review finishing Day 2

1. User and user group rights management

1.useradd [-r/-u/-G/-D][username]: add user,

                -r indicates that the added user is a system user, and the UID is within 500.

                -u means to directly specify a UID for the user to use

                -G followed by the group name means adding the user to this group

                -D. Print out the default value of useradd

2.userdel [-r][username]: delete user

                -r means delete along with the user's home folder

3.usermod: modify user information

4.groupadd [-g|-r][groupname]: Create a new user group. (-g followed by GID, -r means to create a new system user group)

5.groupmod [-g|-n]: Modify user group information, -n means modify the name of the user group

6.groupdel: delete user group

7.gpasswd [-A|-a]: User group administrator function

                -A: Add users after -A to this user group as administrators

                -a: Add subsequent users to this management group

8.grep vbird3 /etc/passwd /etc/shadow /etc/group


9.ps -ef |grep mysql : View the processes related to mysql

10.kill -9 [process ID]: -9 means force, which is the command to kill the process. Process ID found later

11.mkdir: create a directory

12.chgrp: Modify the user group to which you belong

    chown: modify the owning user

    chmod:permissions

    The above 3 followed by -R means recurse to all subfolders below


13. Mount windows shared disk: mount -t cifs -o username=' ',password=' ' 'win shared folder path' 'linux mount path'

        举例:mount -t cifs -o username=byf,password=byf //192.168.1.100/share /usr/test

         cifs is an internet protocol

          df -h can view the mount status

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325620616&siteId=291194637