常用运维命令(持续更新)

查询占用内存高的命令

ps aux –sort=-%mem | head -n 20

查询接口被哪些ip调用

lsof -i -nP

优化内存缓存

sync; echo 3 > /proc/sys/vm/drop_caches

curl的wget替代方案

wget -qO- http://abc.com:8080

创建密钥对

ssh-keygen

ssh-copy-id root@[目标ip]

ssh root@[目标ip]

查询活动的服务

systemctl list-units –type=service –all|grep ” active”

windows桌面电脑排查网络延迟

tracert -d www.baidu.com 跟踪路由

nslookup www.baidu.com 排查dns解析

nslookup www.baidu.com 223.5.5.5 使用阿里的dns排查dns解析问题

强制删除pod

kubectl delete pod gitlab-77c8976db7-q4lxw -n cicd –grace-period=0 –force

清理未用镜像

nerdctl -n k8s.io image prune -f

清理已停止容器

nerdctl -n k8s.io container prune -f

优化swap,内存还剩10%的时候才开始使用swap

cat /proc/sys/vm/swappiness

sysctl -w vm.swappiness=10

echo “vm.swappiness=10” >> /etc/sysctl.conf

路由追踪工具安装和使用

curl nxtrace.org/nt | bash

电信

nexttrace 180.168.255.118

联通

nexttrace 210.22.70.3

移动

nexttrace 211.136.112.50

查看vps性能工具

bash <(curl -sL https://Check.Place) -I

磁盘空间不足排查命令

df -hT

df -ih

du -xhd1 / 2>/dev/null | sort -h

du -xhd1 /var 2>/dev/null | sort -h

find / -xdev -type f -size +500M -printf ‘%s %p\n’ 2>/dev/null | sort -nr | head -30

lsof +L1

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇