tianyun 4 tháng trước cách đây
mục cha
commit
5259be25ee
1 tập tin đã thay đổi với 9 bổ sung0 xóa
  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 "需要一个端口号作为参数"