feat: add lsof

This commit is contained in:
aborn 2023-02-07 18:03:30 +08:00
parent 4e196277b3
commit b8ff159b31
2 changed files with 10 additions and 1 deletions

View File

@ -16,12 +16,15 @@ mvn dependency:tree
# 手动安装jar包到本地
mvn install:install-file -Dfile=/Users/aborn/Downloads/joda-time-2.9.6.jar -DgroupId=joda-time -DartifactId=joda-time -Dversion=2.9.6 -Dpackaging=jar -DgeneratePom=true
# 检查网络端口监听也可以用(linux only)
# 检查网络端口监听也可以用(linux only), mac使用 lsof
sudo netstat -tupln
# mac下查看端口号占用情况如以下查看端口号20881被占用情况
# https://stackoverflow.com/questions/4421633/who-is-listening-on-a-given-tcp-port-on-mac-os-x
sudo lsof -nP -i:20881
sudo lsof -i -P | grep LISTEN
# 具体端口
sudo lsof -i -P | grep LISTEN | grep :$PORT
# grep查找递归查找关键字 Redis
grep -r "Redis" .

6
shell/run-nacos.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
# 启动 nacos
cd /Users/aborn/software/nacos/bin
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_351.jdk/Contents/Home
sh startup.sh -m standalone