add nsgrep to find open ports easily
This commit is contained in:
parent
a3864572f5
commit
2f614ca561
17
init.fish
17
init.fish
|
@ -42,3 +42,20 @@ function psgrep --description 'show matching processes for $argv'
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function nsgrep --description 'show open ports for $argv'
|
||||||
|
switch (count $argv)
|
||||||
|
|
||||||
|
case 0
|
||||||
|
echo -e "No argument given!\nDo you expect me to guess what you're looking for?"
|
||||||
|
return 1
|
||||||
|
|
||||||
|
case 1
|
||||||
|
netstat -tulpen | grep $1 | grep -v grep
|
||||||
|
|
||||||
|
case \*
|
||||||
|
echo "Only 1 arguemnt is valid!"
|
||||||
|
return 1
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in New Issue