add fish config

This commit is contained in:
FlintyLemming
2025-12-25 11:55:17 +08:00
parent 2495d61c93
commit 985cd07f51

View File

@@ -129,6 +129,22 @@ function sudo --description "Replacement for sudo that preserves custom PATH com
end
end
function portcheck
# 设置起始端口,如果没有传入参数则默认为 8840
set -l port 8840
if test (count $argv) -gt 0
set port $argv[1]
end
# 循环检查端口是否被占用
# -t: TCP, -u: UDP, -l: Listening, -n: Numeric
while ss -tuln | grep -q ":$port "
set port (math $port + 1)
end
echo $port
end
abbr -a port 'sudo ss -tulnp | grep'
abbr -a process 'ps aux | grep'