rpm -q xx
Check whether XX is installedyum install xx
Installing xx Software Packagesyum remove xx
Uninstalling xx Software PackagesVim/path
Read and write files- I: Edit mode
- Exc: Exits the command mode
- :wq: Save the configuration and exit Vim
startx
Switch (once) from the command line to the desktop environmentsystemctl get-default
Gets the current boot modesystemctl set-default graphical.target
Change the startup mode to graphicalsystemctl set-default multi-user.target
Example Change the startup mode to command lineInstalling the Desktop Environment
Install the desktop environment (GNOME installed here)systemctl start xx
Starting the XX Servicesystemctl enable xx
The XX service is automatically started upon startupfirewall-cmd --permanent --zone=public --add-port=3389/tcp
The firewall opens port 3389firewall-cmd --reload
Restarting the Firewallsystemctl stop firewalld
Disabling the Firewallsystemctl disable firewalld
Do not enable the firewall upon startup
Cp/path
Copy the filesystemctl daemon-reload
Let service file changes take effect
-
Netstat LNPT | grep xx xx to view the service port
-
Sudo yum update-y
-
Sudo yum install java-1.8.0-openJDK -y install OpenJRE
-
Java-version Checks whether the JRE is installed successfully
-
Sudo useradd -m halo creates a low-level user halo
-
Sudo su halo login user halo
-
Wget URL Downloads the xx installation package
-
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/…
-
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
-
Su XXX # or exit to log in to a user with administrator rights
-
Pkill -kill -t [TTY] Forcibly logs out an existing user
0pkill -kill -t ps1 Copy the code
-
Ls -a # ls –all Displays all files in the current directory
-
Service xx restart Restarts the XX application
-
Curl -o/path –create-dirs URL Downloads configuration files and templates
-
Sudo nginx -t checks whether the nginx configuration is incorrect
-
Sudo nginx -s reload reload the nginx configuration
-
Sudo service xx status Check the running status of xx
-
Sudo service halo Stop stop xx
-
Sudo service halo restart Restart xx
-
Sudo service halo start
-
Sudo systemctl daemon-reload After modifying the service file, you need to refresh Systemd
-
Sudo yum – config – manager – add – repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo add software source information
-
Sudo yum makecache fast Updates the yum cache
-
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.
-
Sudo Docker pull Ruibaby /xx pull the latest mirror of XX
-
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 port
application.yaml
Configuration. - -v: indicates a directory mapping. Do not modify it.
-
Netstat TLN # netstat TLN | grep to find 8080 occupied the port (can meet a specific port number)
-
Netstat -ntlp Displays other ports
-
Lsof -i:8060 Checks the program that the port belongs to and the process that occupies the port
-
Kill -9 Process ID Kill the process that occupies the port
-
Shutdown -h now Power off immediately
-
Shutdown -r now # reboot
-
Docker run –name some-wordpress –link some-mysql:mysql -d wordpress
--name
Name of the container--link
Make connections to other containers-d/--detach
The background
-
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/mysql
Mapped 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
-
Docker ps -a check whether MySQL is running properly
-
Docker stop The container name stops running
-
Docker rm container name delete container (delete -d option)
-
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