tianyun hai 4 meses
pai
achega
5259be25ee
Modificáronse 1 ficheiros con 9 adicións e 0 borrados
  1. 9 0
      sh_config.sh

+ 9 - 0
sh_config.sh

@@ -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 "需要一个端口号作为参数"