Common Linux command collection
Operation Firewall
Add # - allows access to the port number 8084 [@ VM_0_4_centos the root sbin] # Firewall -cmd --add-Port = 8084 / TCP - Permanent success # Reload firewall rules [root @ VM_0_4_centos sbin] # Firewall -cmd - reload success # View firewall rules [root @ VM_0_4_centos sbin] # Firewall -cmd --list-All public target:default ICMP-block-Inversion: NO interfaces: sources: services: ssh dhcpv6-client ports: 8081/tcp 8080/tcp 8088/tcp 8089/tcp 8082/tcp 8083/tcp 8084/tcp protocols: masquerade: no forward-ports: source-ports: icmp-blocks: rich rules:
# Turn off the firewall [root @ VM_0_4_centos sbin] # systemctl STOP firewalld # Turn on the firewall [root @ VM_0_4_centos sbin] # systemctl Start firewalld # Check firewall status [root @ VM_0_4_centos sbin] # systemctl Status firewalld ● firewalld.service- firewalld -Dynamic Firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled) Active: active (running) since Fri 2020-01-31 11:18:25 CST; 3s ago Docs: man:firewalld(1) Main PID: 25686 (firewalld) Tasks: 2 Memory: 28.0M CGroup: /system.slice/firewalld.service └─25686 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid
View port occupancy
#netstat - tunlp see which port numbers are occupied [root@AY120808035024e539829 webapps]# netstat -tunlp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 27893/mysqld tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 2770/redis-server 1 ………………
Copy files
[root@AY120808035024e539829 ~]# cd /opt/java/tomcat/webapps/ [root@AY120808035024e539829 webapps]# pwd / opt / java / Tomcat / webapps
## to / opt / java / all files tomcat / webapps / lop_project folder, copied to the / opt / java / tomcat / webapps / lop_project_house directory [root@AY120808035024e539829 webapps]# cp -r lop_project/. lop_project_house/