Find (AND KILL) port 23515 Mac osx

17,777

Solution 1

From this answer:

lsof -n -i4TCP:23515
lsof -n -i TCP:23515 | grep LISTEN
lsof -n -i:23515 | grep LISTEN

Netstat may also work:

netstat -ap tcp | grep -i "23515" 

Any of these commands should give you the name and PID of the process. Once you have the PID, you can kill the process, or if you know the process name is process_name you can use killall -KILL process_name .

Just for the record though, your terminal isn't running an administrative shell by default. In order to execute commands in terminal as an administrator, you have to use the command sudo su and then enter your password. Once you have a prompt with a #, you can try these commands again, just to be sure.

Solution 2

In one command find and kill:

kill -9 `lsof -i : 23515 -t` or if the existing process was launched by root or an other user: sudo kill -9 `lsof -i : 23515 -t`

lsof -i : 23515 returns the process id using the port 23515 on your machine.

You may also want to restart your computer, just in case the process using this port went into a "zombie" mode or lock the port and went off without freeing the port.

Solution 3

You can try to fine the process listening to those ports:

lsof -i :23515 -t
Share:
17,777
David Iliyn
Author by

David Iliyn

Updated on June 14, 2022

Comments

  • David Iliyn
    David Iliyn almost 2 years

    new here have learned tons over the years and happen to have a pretty puzzling question. I just purchased a product to help edit photos in Adobe Lightroom. Its called a Loupedeck. Comes with software and is a device that controls all the parameters in Lightroom (makes editing way quicker) Once I installed their loupdeck software and opened Lightroom I immediately got this prompt.

    "Loupedeck needs access to tcp ports 23515 and 23516. Other process is currently occupying 23515. Loupedeck will not work until that application is closed."

    I have been searching for days trying to find what app I have installed thats using or used port 23515. I have tried checking in terminal with the simple netstat command, and found nothing. I've used little snitch to see if any programs are using that port, still nothing. Im a little lost and sadly the company is also lost and has no advice.

    Computer - Macbook pro 2011 17" 2.3ghz OSX 10.12.6

    Here is the error in Lightroom

  • David Iliyn
    David Iliyn over 6 years
    Hmm, im getting nothing with trying each line you sent, as well as minhtuannguyen's line he posted.
  • ac1dh0n3ycl0ud
    ac1dh0n3ycl0ud over 6 years
    Have you tried netstat -ap tcp | grep -i "23515" ? If neither lsof nor netstat show an open port, then certainly the OS isn't aware of 23515 being occupied and it may be a bug in the software
  • ac1dh0n3ycl0ud
    ac1dh0n3ycl0ud over 6 years
    OH also: you may have to be an administrator to get all of the information about open ports. Not sure about that but it's possible.
  • David Iliyn
    David Iliyn over 6 years
    I also tried netstat -ap tcp | grep -i "23515" and it gave me nothing :-/ I am the admin of the computer, it sounds like it has to be a bug in the software, there have been a few cases with people running into the same thing.
  • ac1dh0n3ycl0ud
    ac1dh0n3ycl0ud over 6 years
    Well unfortunately all we can do is tell you how to do what you're asking x) If it were open source software, it'd be figured out and fixed lickety-split. Since it's not, you could at least contact customer support :)
  • ac1dh0n3ycl0ud
    ac1dh0n3ycl0ud over 6 years
    I edited my answer to include information about running the commands as an administrator.
  • Stephane Paquet
    Stephane Paquet over 6 years
    @ac1dh0n3ycl0ud your commands are working. @David lliyn, I would recommend the lsof command over netstat for this type of job. My experience with netstat is that some times it freezes (maybe my computer ;-)
  • David Iliyn
    David Iliyn over 6 years
    Crazy, cant find them! Not sure whats going on. Hopefully the company can figure it out otherwise this unit people are purchases is a big ole paper weight...
  • ac1dh0n3ycl0ud
    ac1dh0n3ycl0ud over 6 years
    Did you try running those commands from a root shell? I can't think of a reason why netstat or lsof wouldn't find them as a regular user, but that's the only reason I can think of that those ports might be occupied and you can't see them. Obviously you checked both ports (in case it's actually 23516 that's occupied and the error message is wrong...) ?
  • ac1dh0n3ycl0ud
    ac1dh0n3ycl0ud over 6 years
    ALSO... if you have a firewall, that could be blocking Loupedeck's access to the ports. Check those settings. Specifically, try disabling your firewall then trying to make it work.