tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: "Halte, James" <JHALTE@ci.tacoma.wa.us>
To: "'tru64-unix-managers@ornl.gov'" <tru64-unix-managers@ornl.gov>
Subject: Sorting lsof output
Date: Thu, 04 Mar 2010 16:13:39 -0800	[thread overview]
Message-ID: <7A413832512CF64BA86648F34149D0303680B54A56@mbtpu.Tacoma.lcl> (raw)

I'm currently trying to get a nice output from my lsof utility.

lsof -i > lsof_outputFile
sort -k 9 lsof_outputFile  (this sorts the file by the 9th column "NAME")

My problem is that I want the final output to be sorted by the NAME column, but not sort the
header (first line) of the output. Hence, leave the header alone, then sort the data.

Ex.
COMMAND         PID     USER    FD      TYPE    DEVICE  SIZE/OFF        NODE    NAME
sshd2           1363    user    6u      IPv6    xxxxxx  xxxxxxx TCP     *:ssh (LISTEN)

-----------------------------------------------------------------------------
Thank you, and please feel free to contact me by phone or email.

James Halte
Tacoma Power - T&D EMS Senior Engineer
Office: (253) 502-8094
Cell:    (253) 381-4088
This message may contain confidential or privileged information.  If you are not the addressee, please return the message to its sender and delete it from your files.



                 reply	other threads:[~2010-03-05  0:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox