---
title: "💭 How to kill process based on the port number in Linux - Linux ..."
description: "!https://linuxconfig.org/how-to-kill-process-based-on-the-port-number-in-linux"
date: 2023-10-23
published: true
tags:
  - arch
  - thought
template: link
---


<div class="embed-card embed-card-external">
  <a href="https://linuxconfig.org/how-to-kill-process-based-on-the-port-number-in-linux" class="embed-card-link" target="_blank" rel="noopener noreferrer">
    <div class="embed-card-image">
      <img src="https://linuxconfig.org/wp-content/uploads/2022/08/00-how-to-kill-process-based-on-the-port-number-in-linux.png" alt="How to kill process based on the port number in Linux — Learn to kill a process by port in Linux using fuser, lsof, and ss commands. Essential for system admins managing network processes efficiently." loading="lazy">
    </div>
    <div class="embed-card-content">
      <div class="embed-card-title">How to kill process based on the port number in Linux</div>
      <div class="embed-card-description">Learn to kill a process by port in Linux using fuser, lsof, and ss commands. Essential for system admins managing network processes efficiently.</div>
      <div class="embed-card-meta">LinuxConfig &middot; linuxconfig.org</div>
    </div>
  </a>
</div>


I've often struggled to find and kill a process using a certain port on archlinux.  Mainly becuase most guides use netstat rather than `ss`.


Here is how I just killed the process using port 5000 using `fuser`.

``` bash
sudo fuser -k 5000/tcp
```

You can also get information about the process by running `lsof`


``` bash
❯ lsof -i :5000
COMMAND      PID   USER   FD   TYPE    DEVICE SIZE/OFF NODE NAME
thoughts 1058292 waylon   11u  IPv4 119622828      0t0  TCP *:commplex-main (LISTEN)
```

!!! note

    This post is a <a href="/thoughts/" class="wikilink" data-title="Thoughts" data-description="These are generally my thoughts on a web page or some sort of url, except a rare few don&#39;t have a link. These are dual published off of my..." data-date="2024-04-01">thought</a>. It's a short note that I make
    about someone else's content online <a href="/tags/thoughts/" class="hashtag-tag" data-tag="thoughts" data-count=2 data-reading-time=3 data-reading-time-text="3 minutes">#thoughts</a>
