@@ -208,6 +208,15 @@ function iplocal() {
## 进程相关
alias psgrep='ps aux | grep -v grep | grep'
+# 根据pod获取pid,示例: ss -tunlp | grep :8080
+function getpid-bypod() {
+ if [ -z "$1" ]; then
+ echo "请提供端口号作为参数"
+ return 1
+ fi
+ ss -tunlp | grep ":$1"
+}
+
function killport() {
if [ -z "$1" ]; then
echo "需要一个端口号作为参数"