[unix] How to check whether particular port is open or closed on UNIX?

I am very new to unix. How can I check that a particular port is free or used right now ?

This question is related to unix

The answer is


netstat -ano|grep 443|grep LISTEN

will tell you whether a process is listening on port 443 (you might have to replace LISTEN with a string in your language, though, depending on your system settings).


Try (maybe as root)

lsof -i -P

and grep the output for the port you are looking for.

For example to check for port 80 do

lsof -i -P | grep :80