how can i check port state ?

Hello experts ,

i am wondering , i there a command in Linux that i could check if the port is open or closed without using complex tools such as nmap ,

i mean like that : this is just example is not correct command :
> check port 80
> open

like this .. or if is not there that command how can i easily know that the port 29 is open or closed for example ?

thanx in advance
CFIL
CFILAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
http:// thevpn.guruConnect With a Mentor Commented:
If you are checking on the localhost use netstat

netstat -an | grep 80
or netstat -an  | grep 25
0
 
modcon_jscottCommented:
man telnet
0
 
TintinConnect With a Mentor Commented:
If it's a TCP port, then just do

telnet localhost 80
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
CFILAuthor Commented:
MR modcon_jscott:could you please more specific .

MR Tintin .
yes TCP port , when i type
telnet localhost 80
its give me html codes ,

can i do like this ?
telnet localhost 12
to check port 12 ?

i mean i want a comman that just tell me that if its open or closed ,,any TCP ports i choose it .
please could put some example so i can understand the idea ,
Thankx in advance ,
CFIL
0
 
modcon_jscottConnect With a Mentor Commented:
running the command "man telnet" will give you the man page to the telnet command.

yes changing 80 to 12 will check port 12.

If you are running iptables as your firewall you can run this: iptables -L   this will show you wat ports are open and which ports are closed.

If you want to check quite a few ports, google for a "port scanner"

0
 
http:// thevpn.guruCommented:
adding to the telnet commands if you telnet to a remote daemon and it gives you unable to connect..then in simplest term the tcp port is closed any other result would indicate the port is open..again in the simplest terms.
0
 
CFILAuthor Commented:
thank you very much modcon_jscott and shakoush2001 ,
MR shakoush2001 thank you for helping me always , i wish to meet you :)..
Good Luck .
CFIL
0
 
http:// thevpn.guruCommented:
CFIL ..glad I could help..drop the Mr..we are all peers here :)
0
All Courses

From novice to tech pro — start learning today.