tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* Sorting lsof output
@ 2010-03-05  0:13 Halte, James
  0 siblings, 0 replies; only message in thread
From: Halte, James @ 2010-03-05  0:13 UTC (permalink / raw)
  To: 'tru64-unix-managers@ornl.gov'

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.



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-03-05  0:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-05  0:13 Sorting lsof output Halte, James

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