LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 02-28-2010, 09:18 PM   #1
computergeek7
LQ Newbie
 
Registered: Feb 2010
Distribution: Ubuntu
Posts: 21

Rep: Reputation: 15
Bash Shell scripting help!


What options should I use when I'm using the sort command to sort the top 5 CPU processes (ps -eo user,pid,ppid,%cpu,%mem,fname | sort ??? | head -5) showing max to min usage?

Thanks for your help!!

Last edited by computergeek7; 02-28-2010 at 10:00 PM.
 
Old 02-28-2010, 10:28 PM   #2
grail
Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 7,411

Rep: Reputation: 1873Reputation: 1873Reputation: 1873Reputation: 1873Reputation: 1873Reputation: 1873Reputation: 1873Reputation: 1873Reputation: 1873Reputation: 1873Reputation: 1873
Well I found you can get rid of sort as ps has this option:

ps k-%cpu -eo user,pid,ppid,%cpu,%mem,fname | head -5

Don't forget to mark as SOLVED if your happy with the solution.

Last edited by grail; 03-04-2010 at 07:12 AM. Reason: to be closed
 
Old 03-01-2010, 05:55 AM   #3
computergeek7
LQ Newbie
 
Registered: Feb 2010
Distribution: Ubuntu
Posts: 21

Original Poster
Rep: Reputation: 15
thank you!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Bash shell scripting HLM01 Linux - Newbie 7 01-31-2008 04:23 PM
BASH Shell Scripting tekmann33 Linux - General 4 02-08-2007 05:03 PM
Bash shell scripting using if else nautz Linux - General 10 11-07-2006 09:47 AM
Help with I/O on bash shell scripting Dave6383 Programming 1 06-03-2004 05:24 PM
some bash shell scripting eltongeoff Linux - Newbie 2 10-22-2003 01:10 PM


All times are GMT -5. The time now is 02:28 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration