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/

本文详细介绍了一系列在Linux和Windows环境下进行系统管理的实用命令,包括进程管理、日志查看、文件操作、网络请求发送及DNS缓存刷新等。特别针对开发者在日常工作中可能遇到的问题提供了具体的解决方案。

1784

被折叠的 条评论
为什么被折叠?



