当前位置:网站首页>Shell script kills the process according to the port number
Shell script kills the process according to the port number
2022-07-03 08:53:00 【Xiaoping is extraordinary】
port=8030
# According to the port number to query the corresponding PID
pid = $(netstat -nlp | grep :$port | awk '{print $7}' | awk -F"/" '{print $1}');
# Kill the corresponding process If PID non-existent , That is, the port is not turned on , Do not perform
if [ -n "$pid" ]; then
kill -9 $pid;
fi
边栏推荐
- [rust notes] 02 ownership
- Collection interface
- [concurrent programming] collaboration between threads
- On the setting of global variable position in C language
- LinkedList set
- Unity notes 1
- PHP mnemonic code full text 400 words to extract the first letter of each Chinese character
- DOM render mount patch responsive system
- [concurrent programming] concurrent security
- 数据库原理期末复习
猜你喜欢
SQL statement error of common bug caused by Excel cell content that is not paid attention to for a long time
UE4 source code reading_ Bone model and animation system_ Animation process
Monotonic stack -503 Next bigger Element II
How to use Jupiter notebook
Message queue for interprocess communication
ES6 promise learning notes
Parameters of convolutional neural network
TP5 multi condition sorting
[concurrent programming] thread foundation and sharing between threads
22-06-28 西安 redis(02) 持久化机制、入门使用、事务控制、主从复制机制
随机推荐
DOM 渲染系统(render mount patch)响应式系统
数据库原理期末复习
TP5 order multi condition sort
C language student management system based on linked list, super detailed
Animation_ IK overview
Graphics_ Learnopongl learning notes
注解简化配置与启动时加载
Graphics_ Games101/202 learning notes
[concurrent programming] explicit lock and AQS
How to deal with the core task delay caused by insufficient data warehouse resources
树形DP AcWing 285. 没有上司的舞会
UE4 source code reading_ Bone model and animation system_ Animation process
Deep parsing JVM memory model
Life cycle of Servlet
22-06-27 西安 redis(01) 安装redis、redis5种常见数据类型的命令
Baidu editor ueeditor changes style
[rust notes] 12 closure
How does unity fixedupdate call at a fixed frame rate
Unity editor expansion - scrolling list
Monotonic stack -42 Connect rainwater