Wednesday, April 16, 2008

fuser

fuser - identify processes using files or sockets. Handy:
  • Kick users off of your system. Use 'w' to see what /dev/pts/# they have and then kill that process:
    w
    fuser -k /dev/pts/1
    
  • Find out who's using a service by port. E.g. apache processs:
    $ fuser -n tcp 80
    here: 80
    80/tcp:     22502 22505 22506 22507 22508 22509 22510 22511 22512 23548 27933
    
    A lot like ps axu | grep httpd but while loops are like for loops too. Obvious next steps... who's using SSH? fuser -n tcp 22
  • Determine why a file system is busy

No comments: