Sorting lsof output
"Halte, James" <[email protected]> Thu, 04 Mar 2010 16:13:39 -0800
| Newsgroups | gmane.os.tru64.managers |
|---|---|
| Message-ID | <[email protected]> |
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 NOD= E NAME sshd2 1363 user 6u IPv6 xxxxxx xxxxxxx TCP *:s= sh (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 ar= e not the addressee, please return the message to its sender and delete it = from your files.