1. Check the Linux version: lsb_release-.
2. Get the current kernel name and other information: uname-
3. Check all hosts files under the folder and force Delete: Find./-name "*. MP3" | xargs Rm-RF
4. Search for the hostnames word in all common files in the current directory: find.-Name/*-type-F-print | xargs grep "hostname"
5, packaging files example files, except the folder lib files: tar -- exclude example/WEB-INF/lib-zcvf bak/example2010-12-15.tar.gz example /*
6. Run the program in the background (start the process)
Nohup/usr/local/bin/Python/var/log/httpd/pythoncode/3g/3G. py> nohup-3g.out &
7. copy the file. If the file already exists, overwrite/CP/var/log/httpd/New. log/var/log/httpd/old. log.
8. file synchronization: synchronize new. log_2 on 192.168.1.100 server to the current folder: edit/etc/rsyncd. conf on 192.168.1.100 server.
Add Path =/var/log/httpd
Commnet = counter log
Rsync-A 192.168.1.100: Counter/New. log_2.
9. Restart the Tomcat server and set the scheduled task */3 ***** root/Shell/monitor. Sh
Write monitor. Sh in Shell
Tomcat_dir =/usr/local/Apache-Tomcat-6.0.9
Shell_dir =/root/Shell
CD $ shell_dir
PID = 'ps-Ef | grep "$ tomcat_dir" | grep-V grep | awk '{print $2 }''
CP/dev/null result.txt
Wget -- timeout = 10 -- spider -- append-output = $ shell_dir/result.txt http: // 192.168.1.100: 8080/example/login. jsp
Result = 'cat result.txt | grep "200 OK" | sed-N 1p'
If [-z "$ result"]
Then
Kill-9 $ PID
Sleep 5
CD $ tomcat_dir/bin/
../Myconfig. Sh
./Startup. Sh
Date '+ % F % t'> $ shell_dir/times.txt
Else
Exit 0
Fi
10. View server load: the top Command is a common performance analysis tool in Linux. It can display the resource usage of various processes in the system in real time, similar to the Windows Task Manager.
11. Print the summary of the current system activity: W displays the user information currently logged on to the system
12. df: DF-H
13. Du: view the usage of each directory: Du-sh *