Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.