cd /mnt/opt/cqstt/logs/stt-erp\n\ndocker logs -f --tail=1000 stt-erp\n\n# 查看物理CPU个数\n\ncat /proc/cpuinfo| grep \"physical id\"| sort| uniq| wc -l\n\n# 查看每个物理CPU中core的个数(即核数)\n\ncat /proc/cpuinfo| grep \"cpu cores\"| uniq\n\n# 查看逻辑CPU的个数\n\ncat /proc/cpuinfo| grep \"processor\"| wc -l\n\n#撤销commit\n\ngit reset --soft HEAD^\n\n#批量删除本地分支\n\ngit branch | grep 'xxx' |xargs git branch -D\n\n#删除本地分支\n\ngit branch -d xxx\n\n#删除远程分支\n\ngit push origin --delete xxx\n\n#批量删除远程分支\n\ngit branch -r| grep 'branchName' | sed 's/origin\\///g' | xargs -I {} git push origin :{}\n\n#查找\n\nfind / -name '*xx*'\n\n#设置保存git密码\n\ngit config --global credential.helper store\n\n#\n\ngit branch --contains 28598cd72c5df9501xxxx589c84c8\n\n#查看端口占用\n\nnetstat -tunlp | grep 7080\n\nnetstat -ano | findstr \"8848\"\n\n#文件个数\n\nls -l | wc -l\n\n#查询进程\n\npidof java\n\n#显示进程信息\n\ntop -p 123,32123\n\n#安装deb\n\ndpkg -i\n\n#删除文件\n\nfind . -name \"*.iml\" | xargs rm -rf\n\n#重启桌面\n\nsudo systemctl restart lightdm\n\n#截取文件名称\n\nbasename -s .jpg *.jpg\n\necho $(basename -s .jpg *.jpg) > file.txt\n\n#文件个数\n\nfind . -type f -print | wc -l\n\n#生成iml\n\nmvn idea:module\n\n#mysql\n\nsudo systemctl restart mysql.service\n\n#修改mysql认证方式\n\nALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY 'root';\n\n#clickhouse\n\nsudo systemctl start clickhouse-server\n\n#maven强制更新jar\n\nmvn dependency:purge-local-repository\n\nmvn clean install -U\n\nnohup dbeaver &\n\nrm -rf /opt/maven/repository/com/baomidou\n\nrm -rf /opt/maven/repository/com/alibaba/druid*\n\nrm -rf /opt/maven/repository/com/github/jsqlparser/\n\nrm -rf /opt/maven/repository/com/github/pagehelper/\n\nrm -rf /opt/maven/repository/io/seata*\n\nrm -rf /opt/maven/repository/com/alibaba/cloud/*seata*\n\nrm -rf /opt/maven/repository/org/springframework/cloud/*gateway*\n\njava -jar -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=10000 /mnt/opt/cqstt/stterp-8082/stt-erp-1.1.1.BETA.jar --server.port=8082 --spring.profiles.active=test\n\n#查询外网地址\n\ncurl ifconfig.me\n\nip addr show\n\ngit init\n\ngit remote add origin https://github.com/hy7873/common-utils.git\n\n#批量杀进程\n\nps -ef | grep WeChat | grep -v grep | awk '{print \"kill -9 \"$2}' | sh\n\n./redis-server redis.conf --protected-mode no\n\ndu -h --max-depth=1\n\n#cpu\n\ntop -c\n\ntop -Hp 4075\n\njstack -l 2794 > ./2794.stack\n\n#内存\n\njmap -heap 4075\n\njmap -histo 4075 | head -n 10 > test.txt\n\njmap -dump:live,format=b,file=dump.hprof 15945\n\n./ParseHeapDump.sh hummer.hprof org.eclipse.mat.api:suspects org.eclipse.mat.api:overview org.eclipse.mat.api:top_components\n\nps p 20179 -L -o pcpu,pmem,pid,tid,time,tname,cmd\n\njps -ml\n\nwatch com.letus.omsapi.client.OMSClient paySuccessOpt \"{params,returnObj}\" -x 2\n\ntt -t com.letus.omsapi.client.OMSClient paySuccessOpt -n 3\n\nll -l | grep \"^-\" | wc -l\n\nrar a xx.rar /etc/aa/\n\nrar x aa.rar\n\n#转16进制\n\nprintf '%x\\n' 123\n\n#win中运行jar\n\nchcp 65001 或者设置环境变了 JAVA_TOOL_OPTIONS\n\njava -jar xx.jar\n\n#代理服务设置\n\nsystemctl status firewalld.service\n\nsystemctl start firewalld.service\n\nsystemctl stop firewalld.service\n\nfirewall-cmd --zone=public --add-port=5672/tcp --permanent # 开放5672端口\n\nfirewall-cmd --zone=public --remove-port=5672/tcp --permanent #关闭5672端口\n\nfirewall-cmd --reload # 配置立即生效\n\npython3 /root/shadowsocks/shadowsocks/server.py -m aes-256-cfb -p 44433 -k wh001011\n\npython3 /root/shadowsocks/shadowsocks/server.py -m aes-256-cfb -p 3389 -k wh001011\n\nnohup python3 /root/shadowsocks/shadowsocks/server.py -m aes-256-cfb -p 3389 -k wh001011 &\n\nnetstat -anp\n\n#批量删除\n\nfind . -name '16*' -or -name '24*' | xargs rm -rf\n\n#编辑jar\n\njar -xvf xxx.jar\n\njar -cvf xxx-new.jar BOOT-INF/ META-INF/ org/\n\n#热部署\n\nsc -d *EnumUtils\n\nredefine -c hashcode /xx/xx/xx.class\n\njad com.xx.cc.EnumUtils\n\n#手动GC\n\njcmd 21038 GC.run\n\n#修改文件权限\n\nchmod -R a=wrx /mnt/opt/ a u o g\n\nuname -a\n\ncat /proc/version 内核版本\n\nlsb_release -a 系统版本\n\nmkdir -p /mnt/opt/\n\nnetstat -tunlp\n\n#批量重命名\n\nrename 's/PNG/png/' * debian\n\nrename from to files centos
Linux简单指令统合
最新推荐文章于 2024-09-06 16:58:44 发布