Re:Get answers for Shell Commands from GPT3 right from your ...
by monkpit on Friday November 18, 2022 @12:13PM
(#33657905)
Doesn’t seem like a huge stretch for the AI to check uname and see what system you’re on in order to clarify the answers.
Re:Get answers for Shell Commands from GPT3 right from your ...
by rpsw on Friday November 18, 2022 @12:25PM
(#33658140)
No -p flag for netstat on Mac and -l has different purpose. Closest you can get is
netstat -anv
And then you need to filter for LISTEN.I'm sure there is a few ways to skin the cat, but on Mac the most equivalent to the ss command would probably be:
sudo lsof -iTCP:8000 -sTCP:LISTEN -n -P
In this case the AI answer might be somewhat better for Mac. On Linux I have more often manually installed lsof than ss (iproute2). Maybe Mac provides the similar command netstat which is yet another tool to check ports
Regarding available tools. Another very common Bash question is how to get the directory the executed script is located. A common answer involves `readlink -f` which (as far as I know) does not work on Mac (without extra steps).¹ How to get current users name. Maybe whoami or id -un or logname or echo $USER or who -m or who am i (learnt this last one just today; apparently works with any combination of two arguments after 'who')