Toggle navigation
Sunday Blog
All Posts
go
kubernetes
linux
python
ARCHIVE
DOCS
ABOUT
Sunday Blog
人生是一场刻意练习
常用shell命令整理
Common Shell
# 通过此命令查看内存被哪些进程占用(单位是 MByte),输出 PID 与内存占用大小,通过 PID 可以找到对应进程 for i in `cd /proc;ls | grep "^[0-9]" | awk '$0 >100'` ;do awk '/Swap:/{a=a+$2}END{print '"$i"',a/1024"M"}' /proc/$i/smaps ;done 2>&1 |
Posted by BlueFat on Monday, November 13, 2017
Shell判断输入变量或者参数是否为空
Shell Judge Empty
判断变量为空 if [ ! -n "$word" ] ;then echo "you have not input a word" else echo "the word you input is $word" fi 直接判断 if [ ! "$word" ] ;then echo "you have not input a word" else echo "the word you input is $word" fi 使用test判断 if test -z "$word" ;then echo "you
Posted by BlueFat on Saturday, August 19, 2017
开心的蓝胖
QUICK LINKS
Pxhere
unsplash
FEATURED TAGS
ansible
bash
calico
containerd
docker
firewalld
flannel
grpc
https
iptables
keepalived
kernel
kubernetes
linux
lvs
mysql
network
nginx
prometheus
python
rabbitmq
rocketmq
shell
sort
ssh
tcp
tcpdump
ubuntu
ufw
性能
排序
正则表达式
算法
递归
闭包
FRIENDS
Sunday Docs
Ansible Wiki
K8S训练营
Kubernetes 实践指南