[olug] Unix Tip: IDENTIFY A PROCESSES

Brian Wiese bwiese at cotse.com
Thu Mar 27 09:23:57 UTC 2003


Instead of typing "--inet" to see internet related listening sockets, I
usually just add the "t" and "u" command options to see TCP and UDP ports
respectively.  The "c" option is good for a continuous listing.

netstat -lntcup

(show: listening, port numbers, TCP, continuous, UDP, PID/Program name)

On Wed, 26 Mar 2003 18:09:25 -0600
David Walker <linux_user at grax.com> wrote:

|Another way to show what pid is listening to what port is
|netstat --inet -nlp
|
|and to see what pid matches what active connection use
|netstat --inet -np
|
|(run as root to see full information)
|
|On Wednesday 26 March 2003 04:53 pm, Vincent wrote:
|> An often overlooked feature of fuser is to get the pid which has bound
|> a port: [-- at --- ~/]$ fuser -n tcp 25
|> 25/tcp:               4466
|> [-- at --- ~/]$ ps -p `fuser -n tcp 25 | awk '{print $2}'` fu
|> USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
|> root      4466  0.0  0.0  2448 1228 ?        S    Mar16   0:53
|> sendmail: accepting connections
|>
|>
|>
|>
|>
|> ----- Original Message -----
|>
|> From: "Unix Guru Universe" <listserv at ugu.com>
|> To: <olug at olug.org>
|> Sent: Wednesday, March 26, 2003 1:23 PM
|> Subject: [olug] Unix Tip: IDENTIFY A PROCESSES
|>
|> > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|> >
|> >       UNIX GURU UNIVERSE
|> >          UNIX HOT TIP
|> >
|> > Unix Tip 1911 - March 26, 2003
|> >
|> >     http://www.ugu.com/sui/ugu/show?tip.today
|> >
|> > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|> >
|> >
|> > IDENTIFY A PROCESSES
|> >
|> > The command fuser is very
|> > handy when you want to know
|> > which processes or users
|> > have a file open. Its basic
|> > syntax is:
|> >
|> > /etc/fuser -u /usr/my_application/foo
|> >
|> > You must enter the file's full
|> > path name, as shown above.
|> >
|> > The fuser command is located
|> > under the /etc directory on HP-UX,
|> > AIX and SCO flavors. You must
|> > login as root to use it.
|> >
|> > Its output is a raw list of
|> > processes id numbers and users login
|> > names.
|> >
|> > Please refer to your Unix man pages
|> > to find more about this useful command.
|> >
|> >
|> > This tip generously supported by: tinaco110 at hotmail.com
|> >
|> >
|> >
|> >
|> > --------------------------------------------------------------------
|> > ------ To Subscribe:    http://www.ugu.com/sui/ugu/show?tip.subscribe
|> > To Unsubscribe:  http://www.ugu.com/sui/ugu/show?tip.unsubscribe
|> > To Submit A Tip: http://www.ugu.com/sui/ugu/show?tip.today
|> >
|> > ====================================================================
|> > ====== DISCLAIMER: All UNIX HOT TIPS ARE OWNED BY THE UNIX GURU
|> > UNIVERSE AND ARE NOT TO BE SOLD, PRINTED OR USED WITHOUT THE WRITTEN
|> > CONSENT OF THE UNIX GURU UNIVERSE. ALL TIPS ARE "USE AT YOUR OWN
|> > RISK". UGU  ADVISES THAT ALL TIPS BE TESTED IN A NON-PRODUCTION
|> > DEVELOPMENT ENVIRONMENT FIRST.
|> >
|> > Unix Guru Universe - www.ugu.com - tips at ugu.com - Copyright 1994-2001
|> > ====================================================================
|> > ======
|> >
|> > _______________________________________________
|> > OLUG mailing list
|> > OLUG at olug.org
|> > http://lists.olug.org/mailman/listinfo/olug
|>
|> _______________________________________________
|> OLUG mailing list
|> OLUG at olug.org
|> http://lists.olug.org/mailman/listinfo/olug
|
|_______________________________________________
|OLUG mailing list
|OLUG at olug.org
|http://lists.olug.org/mailman/listinfo/olug
|


  Brian Wiese | bwiese at cotse.com | aim: unolinuxguru
------------------------------------------------------
  GnuPG/PGP key 0xF3220030 | "FREEDOM!" - Braveheart 
------------------------------------------------------  
This is not about Napster or DVDs. It's about your Freedom.
  I'll see your DMCA and raise you a First Amendment.
              http://www.anti-dmca.org


More information about the OLUG mailing list