Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking for a command to see the process listening to a port, e.g. /dev/ttyS0 (with root rights on a Linux system). I can do that with

lsof /dev/ttyS0

but this is really too slow. Also, I cannot use the -p flag to make it faster.

I would like to do essentially the same using other resources of the linux system. Is that possible?

share|improve this question

I've only tried it with a virtual console, but this will work (at least for some resources. I don't have a Serial port, but it worked for my tty's)

fuser -n file /dev/ttyS0

(As root, of-course)

Similarly you can look up things speaking to a socket with fuser -n tcp|udp XXXX

share|improve this answer
    
Unfortunately, I do not have the -n option available. But I will look into fuser. – Alex Mar 21 '13 at 7:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .