Review your favorite Linux distribution.
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 05-19-2005, 03:50 AM   #1
Registered: Jul 2003
Location: indore, india
Posts: 69

Rep: Reputation: 15
find process runnning on particular port

I need to do following:

I have my service(eg my chat server) running on some port number say 1025.
Now I need to restart that server every day by cron. For that I need to kill all processes of this service running on that port.
How can I do this??

I thought of this idea:
Write a shell script that will find all the processes running on that port and kill them. Then execute the start command for that service.

But I am not able to kill the processes running on some port..

Please help me in this..

Old 05-19-2005, 09:09 AM   #2
Registered: Jul 2004
Location: Czech Republic - Roudnice nad Labem
Distribution: Debian
Posts: 253

Rep: Reputation: 34
this kill all processes at port 1025 (TCP)
/sbin/fuser -k 1025/tcp
UDP version:
/sbin/fuser -k 1025/udp

if you remove -k (kill switch), you will see all PIDs that using this port


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
Using serial port card(PCMCIA) with IPAQ running Linux, can't find ttyS0 port d2army Linux - Laptop and Netbook 0 11-12-2005 08:07 PM
Process and TCP Port jonty_11 Programming 7 02-22-2005 06:27 PM
Port 80 is in use by some process Bill Fox Linux - General 2 01-17-2005 04:48 PM
Per port/process bandwidth bratch Linux - Networking 2 12-11-2004 11:40 AM
How to filter traffic using port+process in IPTables muath Linux - Security 10 03-01-2004 11:20 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:32 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration