From owner-freebsd-questions@FreeBSD.ORG Sat Nov 17 19:47:37 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B69F616A420 for ; Sat, 17 Nov 2007 19:47:37 +0000 (UTC) (envelope-from elrap@web.de) Received: from fmmailgate01.web.de (fmmailgate01.web.de [217.72.192.221]) by mx1.freebsd.org (Postfix) with ESMTP id 798F313C461 for ; Sat, 17 Nov 2007 19:47:37 +0000 (UTC) (envelope-from elrap@web.de) Received: from smtp07.web.de (fmsmtp07.dlan.cinetic.de [172.20.5.215]) by fmmailgate01.web.de (Postfix) with ESMTP id 4DBF3B209E3B; Sat, 17 Nov 2007 20:47:28 +0100 (CET) Received: from [84.152.191.123] (helo=freebsdangel.de) by smtp07.web.de with asmtp (WEB.DE 4.108 #208) id 1ItTdY-0002En-00; Sat, 17 Nov 2007 20:47:28 +0100 Message-ID: <473F453D.5020806@web.de> Date: Sat, 17 Nov 2007 20:47:09 +0100 From: Tino Engel User-Agent: Thunderbird 2.0.0.6 (X11/20071110) MIME-Version: 1.0 To: Matthias Apitz References: <1195154430.473c9bfef18f0@webmail.rawbw.com> <20071117140449.GA7094@rebelion.Sisis.de> In-Reply-To: <20071117140449.GA7094@rebelion.Sisis.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Sender: elrap@web.de X-Sender: elrap@web.de X-Provags-ID: V01U2FsdGVkX18hTJVVCIWBgALgNcuZsGqyVXoj4Z9kStom+S7M TC4cJJ3nGGpwKC4duZFBWywCoJuBeuAFizaq2u/tLPyygD+1SW YDSjOVf/4= Cc: Yuri , freebsd-questions@freebsd.org Subject: Re: How to know PID responsible for network connection/listen? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2007 19:47:37 -0000 Matthias Apitz schrieb: > El día Thursday, November 15, 2007 a las 11:20:30AM -0800, Yuri escribió: > > >> 'netstat -a' gives me the listing of network connection/listening records. >> But there's no link to the process id that opened it. >> With lots of processes this can be a significant problem to figure out who >> opened which connection. >> > > For example, for the port 25 you see it with: > > # lsof -P | fgrep :25 > sendmail 6462 root 3u IPv4 0xc5c3ecb0 0t0 TCP localhost:25 (LISTEN) > > i.e. the PID is 6462 > > HIH > > matthias > ps -Al show the parent PID of each process.