1. rpm -q xxCheck whether XX is installed
  2. yum install xxInstalling xx Software Packages
  3. yum remove xxUninstalling xx Software Packages
  4. Vim/pathRead and write files
    • I: Edit mode
    • Exc: Exits the command mode
    • :wq: Save the configuration and exit Vim
  5. startxSwitch (once) from the command line to the desktop environment
  6. systemctl get-defaultGets the current boot mode
  7. systemctl set-default graphical.targetChange the startup mode to graphical
  8. systemctl set-default multi-user.targetExample Change the startup mode to command line
  9. Installing the Desktop EnvironmentInstall the desktop environment (GNOME installed here)
  10. systemctl start xxStarting the XX Service
  11. systemctl enable xxThe XX service is automatically started upon startup
  12. firewall-cmd --permanent --zone=public --add-port=3389/tcpThe firewall opens port 3389
  13. firewall-cmd --reloadRestarting the Firewall
  14. systemctl stop firewalldDisabling the Firewall
  15. systemctl disable firewalld

Do not enable the firewall upon startup

  1. Cp/pathCopy the file
  2. systemctl daemon-reload

Let service file changes take effect

  1. Netstat LNPT | grep xx xx to view the service port

  2. Sudo yum update-y

  3. Sudo yum install java-1.8.0-openJDK -y install OpenJRE

  4. Java-version Checks whether the JRE is installed successfully

  5. Sudo useradd -m halo creates a low-level user halo

  6. Sudo su halo login user halo

  7. Wget URL Downloads the xx installation package

  8. useradd [-d home] [-s shell] [-c comment] [-m [-k template]] [-f inactive] [-e expire ] [-p passwd] [-r] name Using the useradd or adduser command, you can create a user account and the start directory of the user. The permission is super user

    The main parameters

    • -c: Adds remarks. The remarks are saved in the remarks column of passwd.
    • -d: specifies the home directory for the user to log in to. Replace the default value /home/< username >.
    • -d: Changes the default value.
    • -e: specifies the expiration date of the account. The date format is MM/DD/YY, for example, 06/30/12. By default, it is permanent.
    • -f: specifies the number of days after the password expires that the account will be closed. If the value is 0, the account will be disabled immediately. If the value is -1, the account is always available. The default value is -1.
    • -g: specifies the group to which the user belongs. The value can be the group name or GID. The user group must already exist. The default value is 100, that is, Users.
    • -g: specifies the additional group to which the user belongs.
    • -m: automatically establishes the user login directory.
    • -m: Do not automatically create the user login directory.
    • -n: Cancels the creation of a group using the user name.
    • -r: establishes a system account.
    • -s: specifies the shell used by the user after login. The default value is /bin/bash.
    • -u: specifies the user ID. This value must be unique in the system. The value from 0 to 499 is reserved for system user accounts by default. Therefore, the value must be greater than 499.

    www.cnblogs.com/irisrain/p/…

  9. W # whoami view the current logged-in user

    12:10:27 up 21:13, 1 user, load average: 0.00, 0.01, 0.08 USER TTY FROM login@idle JCPU PCPU WHAT root PTS /0 ***.**.***.** 11:330.00 s 0.08s 0.00s w TMP_3254 ps1 ***.** *.** 11:33 0.00s 0.08s 0.00s lsCopy the code
  10. Su XXX # or exit to log in to a user with administrator rights

  11. Pkill -kill -t [TTY] Forcibly logs out an existing user

     0pkill -kill -t ps1
    Copy the code
  12. Ls -a # ls –all Displays all files in the current directory

  13. Service xx restart Restarts the XX application

  14. Curl -o/path –create-dirs URL Downloads configuration files and templates

  15. Sudo nginx -t checks whether the nginx configuration is incorrect

  16. Sudo nginx -s reload reload the nginx configuration

  17. Sudo service xx status Check the running status of xx

  18. Sudo service halo Stop stop xx

  19. Sudo service halo restart Restart xx

  20. Sudo service halo start

  21. Sudo systemctl daemon-reload After modifying the service file, you need to refresh Systemd

  22. Sudo yum – config – manager – add – repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo add software source information

  23. Sudo yum makecache fast Updates the yum cache

  24. Mirror to accelerate

    # Create a daemon.json file
    sudo vim /etc/docker/daemon.json
    Copy the code

    Copy the following configuration:

    {
      "registry-mirrors": ["http://hub-mirror.c.163.com"]}Copy the code

    Note: After modifying the configuration file, run the service docker restart command for the modification to take effect.

  25. Sudo Docker pull Ruibaby /xx pull the latest mirror of XX

  26. Docker run –rm it -d –name halo -p 8090:8090 -v ~/. Halo :/root/. Halo ruibaby/halo Create a container and run halo

    • –rm: The container is automatically deleted after being stopped.
    • –name: indicates the container name.
    • -p: occupied port. The former is the host port and the latter is the Halo running portapplication.yamlConfiguration.
    • -v: indicates a directory mapping. Do not modify it.
  27. Netstat TLN # netstat TLN | grep to find 8080 occupied the port (can meet a specific port number)

  28. Netstat -ntlp Displays other ports

  29. Lsof -i:8060 Checks the program that the port belongs to and the process that occupies the port

  30. Kill -9 Process ID Kill the process that occupies the port

  31. Shutdown -h now Power off immediately

  32. Shutdown -r now # reboot

  33. Docker run –name some-wordpress –link some-mysql:mysql -d wordpress

    • --nameName of the container
    • --linkMake connections to other containers
    • -d/--detachThe background
  34. docker run -d –privileged=true –name myMysql -v /data/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 -p 33306:3306 Mysql :5.6

    • -p: port mapping. 33306 indicates the host, and 3306 indicates the port in the container. Map 33306 of the host to 3306 of the mirror.
    • -e: environment variable. The environment variable is related to the setting of the Docker container. It is 123456 when setting the root password of MySQL in the image
    • -v: specifies the data volume that will be added to our MySQL container/var/lib/mysqlMapped to the host/data/mysql
    • --privileged=true:Security Selinux on CentOS disables some security permissions. As a result, the MySQL container will report an error when running because of insufficient permissions. Therefore, you need to add this option
  35. Docker ps -a check whether MySQL is running properly

  36. Docker stop The container name stops running

  37. Docker rm container name delete container (delete -d option)

  38. Quickly delete Docker images or containers in batches

    Docker itself does not provide the function of batch deletion. When a large number of images or containers need to be deleted, it is troublesome to delete them one by one manually.

    Rmi 'docker images -q' # rm 'docker images -q' # rm 'docker images -q' # rm 'docker images -q' # rm 'docker images -q' # rm 'docker images -q' # rm 'docker images -q' # rm 'docker images -q' # rm 'docker images -q' # rm 'docker images -q' # rm 'docker images -q Docker rmi ` docker images | grep XXXXX | awk '{print $3}' ` # according to the condition of screening after delete container docker rm ` docker ps - a | grep XXXXX | awk '{print $1}'`Copy the code