摘要:
ss -lntup |grep 5000 |awk '{match($0,/pid=(.+)+(,fd=)/,a);print a[1]}' 使用了awk的match用法 [root@master1 Python-3.8.2]# ss -lntup |grep 5000 tcp LISTEN 0 1 阅读全文
posted @ 2023-03-09 17:07
程少亭
阅读(3)
评论(0)
推荐(0)
摘要:
判断用户是不是XXX id号是否为XX 不是则返回 测试结果 if [[ `whoami` = "root" && `id -u` -eq 0 ]];then echo "该用户为root" else echo -e "\e[1;31mERROR: 当前为非root用户登录,该服务需要以root权限 阅读全文
posted @ 2023-03-09 15:04
程少亭
阅读(10)
评论(0)
推荐(0)

浙公网安备 33010602011771号