Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-06-2004, 04:13 PM   #1
Registered: Dec 2003
Location: Turkey
Distribution: Suse
Posts: 89

Rep: Reputation: 15
Port Number?

How can i see the active port number on linux and the program name which is using that port?

Old 11-06-2004, 04:56 PM   #2
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
netstat -l -p
Old 11-06-2004, 04:56 PM   #3
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Read the netstat man page, particularly noting the -p option.
Old 11-06-2004, 05:10 PM   #4
Registered: Dec 2003
Location: Turkey
Distribution: Suse
Posts: 89

Original Poster
Rep: Reputation: 15

how can i close theport or the program that is using that port
Old 11-06-2004, 05:16 PM   #5
Registered: Nov 2000
Location: Hermon, ME
Distribution: slackware
Posts: 201

Rep: Reputation: 30
well the program ou can kill with kill -9 pid# to close a port comment it out of inetd.conf and restart
Old 11-06-2004, 05:50 PM   #6
Registered: Jun 2003
Location: Front of PC
Distribution: Linux Mandrake
Posts: 212

Rep: Reputation: 30
Best command is
"netstat -tap|grep LISTEN"

Thats gives you the list of all servers listening for connection requests from the internet.

Also, you can use GUI's (gnome-network-conf or knetmap or something along those lines is the command to the gui that has a netstat menu u can use in case u don't want to read man pages or remember a whole bunch of flags)

shut off unnecessary services using kill (make sure they're not set as symlinks in /etc/rc.d/rc<whatever>.d/ or else they'll start up again the next time u reboot). U can use GUI's to do that too (like tksysv or ksysv).


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
port number. bruse Linux - Networking 1 11-28-2005 02:13 PM
Port number.... help rajsun Programming 2 04-12-2005 09:20 AM
Ip and port number Alien18 Linux - Networking 1 09-13-2004 09:40 PM
Changing port number cli_man Linux - General 2 04-20-2002 08:50 AM
right port number gogo Linux - General 1 05-07-2001 03:52 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:20 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration