Linux:
1.查看所有的 java 進程: ps -ef|grep java|grep -v grep
2.查看selenium進程: ps aux|grep selenium
3.查看tomcat進程: ps aux|grep tomcat
4.kill 進程:kill -9 27027 或者 Linux下還提供了一個killall命令,可以直接使用進程的名字而不是進程標識號,例如:# killall -9 NAME
5.查看log:
(1)tail -100 jvm-s0.log
(2)tail -n 20 example.txt
6.Linux 刪除文件夾:
rm -rf /data/team/apache-tomcat-7.0.76/webapps/wsst
7.查找並刪除符合條件的文件
(1)find /data/home/team/WebApps/testwork/DataDiff -iname 'cm_prod_*'
(2)find /data/home/team/WebApps/testwork/DataDiff -iname 'cm_prod_*' |xargs rm -rf
8.批量修改 sjXXtst10 成sjXXtst14
(1)批量查找:find /data/home/team/funcases/west/Medicare-NewWebservice -name "*script.html" |xargs grep -rl "sjXXtst10"
(2)批量修改:sed -i "s/sjXXtst10/sjXXtst14/g" `find /data/home/qateam/funcases/west/Medicare-NewWebservice -name "*script.html" |xargs grep -rl "sjXXtst10"`
9.複製目錄到指定路徑:
cp -R /data/qateam/WebApps/wst /data/qateam/apache-tomcat-7.0.76/webapps
10.(1)Linux get 請求:
curl https://www.ehealthinsurance.com/ --insecure
(2)Linux POST 請求:(HTTPS)
curl -k -H "Content-type: application/json" -X POST -d '{"limit":-1,"radius":5,"zipCode":"66869","providerType":"physician","searchType":"physician","random":true,"plan":{"planId":264,"carrierId":66121400}}' 'https://sjqpprse-app-vip.ehealthinsurance.com:8443/provider/api/internal/provider/plan.json'
Windows:
1.用命令實現Win7遠程桌面關機和重啓
關機 shutdown -s -t 0
重啓 shutdown -r -t 0
2.Windows 查看端口占用: https://blog.csdn.net/wwq147852/article/details/78721983
(1)各個端口占用和進程PID :netstat -ano
(2)8080 端口被佔用:
netstat -aon | findstr "8080"
步驟:(需要admin權限)
C:\Windows\system32>netstat -ano|findstr "5555"
TCP 0.0.0.0:5555 0.0.0.0:0 LISTENING 3208
TCP 10.7.77.152:5555 10.7.77.151:59938 ESTABLISHED 3208
TCP [::]:5555 [::]:0 LISTENING 3208
(3)查找task
C:\Windows\system32>tasklist | findstr "3208"
java.exe 3208 2 88,224 K
(4)kill task
C:\Windows\system32>taskkill -PID 3208 -F
SUCCESS: The process with PID 3208 has been terminated.
3.刷新 DNS 的cache: (cmd)
ipconfig /flushdns
4.telnet URL 端口號 :telnet hostName 端口號
例如:telnet sjQAmcmydb01 3306
telnet db-scan 1521
telnet db-scan 1521
Connecting To db-scan...Could not open connection to the host, on port 1521: Connect failed
一些實用網址:
Maven Repository: http://mvnrepository.com/
Stack Overflow: http://stackoverflow.com/