LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-17-2006, 03:39 AM   #1
dazdaz
Member
 
Registered: Aug 2003
Location: Europe
Distribution: RHEL, CentOS, Ubuntu
Posts: 333

Rep: Reputation: 17
lastcomm and .bz2 accounting files


Hi,

Is there a good one liner to uncompress and read the output and sort it by high load average on any .bz2 process accounting file ?

I recently thought the command below worked, but now I see it does'nt work at all and lastcomm just reads the current file.

I wanted to avoid copying the file to /tmp, uncompressing and then reading it.

Is there a simple way around this, I can't help but think i'm missing something obvious.

bzip2 -dc pacct.0116.bz2 | lastcomm -- | sed 's/ \([0-9]\)/~\1/' | awk -F"~" 'BEGIN{OFS="~"}{ print $2,$1 }' | sort -n | awk -F"~" '{ print $2,$1 }' | tail -25

Thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
.bz2 files Mr. Hill Linux - Newbie 4 03-13-2005 04:19 AM
How can konqueror view html files in .gz & .bz2 files directly? ailinzhe Linux - Software 5 05-24-2004 08:36 AM
User and Process Accounting Log Files lafinhyena Linux - Newbie 0 05-19-2004 03:57 AM
Getting the buzz on bz2 files caleb star Linux - Newbie 1 02-05-2004 10:28 AM
installing bz2 files? MrGardenHoseMan Linux - Software 2 07-03-2003 03:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration