博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

linux 调试工具

Posted on 2014-01-15 16:31  bw_0927  阅读(120)  评论(0)    收藏  举报
  • gdb
  • strace
  • dstat
  • lsof

  The lsof -i command lists all open files associated with Internet connections. It is similar in format to netstat -a -p .

lsof –i :587
lsof –i :smtp
lsof –i @labrat.remote.net

LSOF will then output all matching connections. The above examples will list connections listening or established on port 587, list connections associated with the well-known service SMTP, and list connections coming from or going to the host labrat.remote.net, respectively. 

lsof -p 409
LSOF will also accept a PID and output all open files it is using. 

lsof -nP -p pid   显示IP和端口,而不是域名

 

     lsof +d /a/directory     显示该目录下所有文件对应的使用进程

  • fuser
  • proc文件系统   /proc/net/unix
  • ss
  • netstat
  • pstree
  • tcpdump