Common Linux Commands

RPM -e (--nodeps) ****. RPM # Uninstall the RPM file (--nodeps) RPM - qa | grep mysql # for installation of mysql software ps - e | grep mysql # find systemctl start/stop/restart/mysql process status mysqld. Service Mysqld chown -r /home/mysqldata/ chown mysql:mysql mysqldata -r rm -rf mysql/ tar -xvf Find / -name errmsg. Sys find / -name errmsg. Sys / - name 'Java' -type d # # in/directory lookup Java directory roboot restart netstat tunlp | grep (TCP) show only the TCP port number - t options -u (udp) show only the udp options - n Refuse to display aliases, Can display all into digital Numbers - l just listed in Listen (Listen) service status - p shows that establish a link to the program name netstat - an | findstr searches 8772 # to check 8772 port usage df -h # check disk capacity use lsof condition -i:8080 # check whether port 8080 is used kill -9 PID systemctl list-unit-files # Check whether mysqld is used Firewall-cmd --zone=public --add-port=5672/ TCP --permanent # Open port 5672 firewall-cmd --zone=public --remove-port=5672/ TCP - permanent firewall - CMD - reload # # close port 5672 configuration take effect immediately yum search Java | grep JDK yum install Java -- 1.8.0 comes with its established soft links: Ln -s /usr/local/node-v4.2.6-linux-x86/bin/node /usr/local/bin/node Rm -rf /usr/local/bin/node-v4.2.6-linux-x86/bin/to delete the soft link: rm -rf /usr/local/bin/node PWD #
#Copy a remote host file to a local directorySCP [email protected]: / etc/redhat - release/root is firewall - CMD - zone = public - add - port # = 5672 / TCP - permanent open port 5672 Firewall-cmd --zone=public --remove-port=5672/ TCP --permanent # Disable 5672 port firewall-cmd --reload # The configuration takes effect immediately --zone=public --list-ports # Check all open firewall ports systemctl stop firewald. service # Check firewall status firewall-cmd --state # Check firewall status netstat - LNPT # check listen port netstat LNPT | grep 5672 # to check port is occupied by a which processCopy the code

Common SQL commands

mysqldump -uroot -proot --all-databases >/tmp/all.sql
Copy the code
select TABLE_NAME, Concat (TRUNCate (data_LENGTH /1024/1024,2),' MB') as data_size,table_rows from information_schema.tables WHERE TABLE_SCHEMA = 'replace your database name' ORDER BY table_rows; Select * from table_name where table_name = 1Copy the code
show master logs;
reset master;
show status like 'wsrep%';
Copy the code
systemctl status [email protected]
Copy the code

Common vi command

Insert :wq # exit without saving dd # delete a line G # go to the end dG # Clear the document /find # find the 'find' character N # Find the next ESC # Exit insert modeCopy the code

Docker command is commonly used

docker exec [OPTIONS] CONTAINER COMMAND [ARG...] -d: separate mode: Run in the background -i: keep STDIN open even if no attachment is attached -t: Assign a dummy terminal docker exec it tracker bash # enter the service tracker root in dockerCopy the code

Example:

CloseableHttpClient httpClient = HttpClientBuilder.create().build(); Map<String,Object> requetBody = new TreeMap<>(); requetBody.put("device_sn","MD70200600001"); requetBody.put("start_time",1598976000000L); requetBody.put("end_time",1604159999000L); requetBody.put("page",1); requetBody.put("per_page",10); HttpPost post = new HttpPost("http://medc.medciot.com/api/product/getIvd70QCData"); //url post.addHeader("Authorization", "Bearer 8d9a9e2a604e410f8e5ad6d09afbdca2"); //token StringEntity entity = new StringEntity(JSON.toJSONString(requetBody), ContentType.APPLICATION_JSON); post.setEntity(entity); HttpResponse response = null; try { response = httpClient.execute(post); } catch (IOException e) { e.printStackTrace(); } if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { System.out.println(EntityUtils.toString(response.getEntity(), "utf-8")); }Copy the code