bash: telnet: command not found [closed]
Asked Answered
D

1

7

I'm trying to connect the server using telnet, but when I enter telnet localhost 8000. It shows the error of telnet not found. I wrote my code in C and ran it on macOS terminal. Am I supposed to install something before I can use it?

Defalcate answered 3/2, 2022 at 18:6 Comment(5)
Why tag this Linux if you're using a Mac? And C?Pinon
Sorry if that is confusing. I also ran it on Linux and Mac terminal, but having the same problem.Defalcate
telnet doesn't come by default on Mac (at least, it's not on my MacBook). You can see here for how to install it.Redeploy
telnet is a somewhat outdated standard program. Apparently you have to install it. For details how to install it on Linux you would have to tell your Linux distribution and version. Please edit your question to add information or clarification. Don't use comments for this purpose.Levitus
To mark the question as solved you would have to accept an answer or write your own answer and accept it. Regarding this specific question, the answer should contain details about how exactly you installed telnet.Levitus
F
15

Yes you would need to install telnet to use it on your mac. You can also try using an alternative tool, that comes pre-installed on macOS machines. It is called netcat and you can do the following:

nc -vz localhost 8000

If the command above is not good enough, you can install telnet on your mac by following the tutorial that can be found here:

https://osxdaily.com/2018/07/18/get-telnet-macos/

More precisely, the section titled: Installing Telnet in MacOS with Homebrew

You will need to install homebrew (it is a package manager for MacOS, similar to yum or apt in linux).

Felonious answered 3/2, 2022 at 18:10 Comment(4)
I am not sure if we are allowed to share 3rd party links here but if you google 'install telnet macos' you'll find plenty of tutorialsFelonious
Please edit your answer to add information instead of writing a comment. Yes, you can show a link to a tutorial, but you should also cite the relevant part in your answer, so that the essential answer is found here directly.Levitus
Thank you for your help!Defalcate
brew install telnet formulae.brew.sh/formula/telnetQuartern

© 2022 - 2024 — McMap. All rights reserved.