★ Temporarily SET environment variable export m2_home=/home/workspace/apache-mavenexport path= $PATH: $M 2_home/bin★ Loop Delete Directory no confirmation prompt rm-rf "directory name" prompt RM- F "directory name" ★ps-aux | grep Tomcat View Tomcat occupied ports ★ View CPU Usage Top Refresh 10 times after launch top-n 10★ View Cup count and number of cores
# total number of cores = number of physical CPUs x number of cores per physical CPU # Total Logical CPUs = number of physical CPUs x number of cores per physical CPU X number of hyper-threads # View the number of physical CPUs cat/proc/cpuinfo| grep "Physical ID" | Sort| uniq| wc-l# See the number of cores in each physical CPU (that is, the number of nuclei) cat/proc/cpuinfo| grep "CPU Cores" | uniq# View the number of logical CPUs cat/proc/cpuinfo| grep "Processor" | Wc-l
★ View Memory Utilization free-m ★ View disk partition usage Df-l or df-h ★ view port NETSTAT-ANP view 8080 Port Netstat-anp | grep 8080 ★ Find command Find File Find-name ' Mingzi ' Look for empty file Find-empty find files of the specified size find-size [bckw] default to B for 512-byte blocks find files of the specified type finds -type x, X is one of the following characters B block device file C character device file D directory file p named pipe (FIFO) f normal file L Symbolic link file (symbolic Links) s socket file-xtype X same as-type, but only find symbolic link file &n bsp;★ copy files between two Linux servers (copy folder plus-r parameter) scp /home/daisy/full.tar.gz [email protected]:/home/rootscp [ Email protected]:/home/root/full.tar.gz/home/daisy/ ★zipzip-r myfile.zip./* "-R for recursive compression subdirectories" Unzip-o -d/home/sunny myfile.zip "-O without prompting for overwriting files,-D indicates extracting files to the specified directory" multiple file directories separated by spaces ★tar Z GZ package C creates v output compression process TAR-CVF All.tar *. JPG TAR-CZVF All JPG files in the directory into tar packages all.tar.gz *.jpg Convert all JPG files in the directory to tar and compress TAR-CJF all.tar.bz2 *.jpg with gzip bzip2 all JPG files in the directory into tar and compress tar-xvf All.tar unpack the tar package TAR-XZVF all.tar.gz Unpack tar.gz package TAR-XJVF all.tar.bz2 unpack tar.bz2 pack ★md5sum Deploy.war output Deploy.war MD5 value ★ operation file: Download sz upload rz large file plus parameters-bey ★ View disk df-h ★ view IP hostname-i or ifconfig★ fire strong $sudo UFW default deny $sudu ufw disable $sudo UFW enable& nbsp; $sudo UFW allow 22 because in/etc/services, the service name corresponding to the 22 port is ssh. So the following command is the same: $sudo UFW allow ssh Now you can view the status of the firewall with the following command: $sudo UFW status Firewall loaded to action from -- ---------- 22:tcp ALLOW Anywhere 22:udp ALLOW Anywhere We can see that the TCP and UDP protocols for the  22 ports are turned on. Delete a rule that has already been added: $sudo UFW Delete Allow 22 Only open 22 port with TCP/IP protocol: $sudo UFW allow 22/tcp Open a TCP request from 192.168.0.1 of 80 port: $sudo UFW allow proto TCP from 192.168.0.1 to any port 22 ★ change the file Chown-r Aruid:aruid settings.xml ★top-bn 2 Show All process information Display 2 screen ★du -h view the cluster size of the folder, a cluster is 4k depending on the system and Nbsp;★ls-l List -a show hidden files -h display file size units [[email protected] zookeeper]# Ls-lah
Total 19M
Drwxr-xr-x. 6 root root 4.0K Sep 26 18:03.
Drwxr-xr-x. 6 root root 4.0K Sep 26 16:32..
Drwxr-xr-x. 5 root root 4.0K Sep 17:32 Server1
Drwxr-xr-x. 5 root root 4.0K Sep 17:32 server2
Drwxr-xr-x. 5 root root 4.0K Sep 17:31 server3
Drwxr-xr-x. 4.0K zookeeper-3.4.6
-rw-r--r--. 1 root root 17M Sep 16:54 zookeeper-3.4.6.tar.gz
-rw-r--r--. 1 root root 2.0M Nov 6 07:41 zookeeper.out★ Delete log files based on time ls-t log.* | Tail-n +10 | Xargs rm-f★tail log.log-n +10 starts at line tenth as the starting line toward the file tailtail log.log-n tail File The last 10 lines
Linux Common commands