The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
find and replace command in one line using one command vasikaran UNIX for Dummies Questions & Answers 10 08-20-2008 07:40 AM
how to? launch command with string of command line options TinCanFury Shell Programming and Scripting 5 04-28-2008 03:06 PM
Add line command felixwhoals UNIX for Dummies Questions & Answers 3 12-16-2007 08:12 PM
how to tell which OS via command line hankooknara UNIX for Dummies Questions & Answers 4 05-15-2007 08:39 PM
How do I get ssh to run a command in one line? LordJezo Shell Programming and Scripting 2 07-01-2004 08:54 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #15 (permalink)  
Old 07-14-2004
Registered User
 

Join Date: May 2004
Posts: 66
Quote:
Originally posted by beilstwh
Try

ps -e -o pid,pcpu,comm|head -n1;ps -e -o pid,pcpu,comm|tail +2|grep "${user}"
Tried that and this is what i got:
Code:
$ ps -e -o pid,pcpu,comm|head -n1;ps -e -o pid,pcpu,comm|tail +2|grep "${user}"
  PID %CPU COMMAND
$
running on Linux.
Reply With Quote
Forum Sponsor
  #16 (permalink)  
Old 07-14-2004
Registered User
 

Join Date: Jul 2004
Location: New York State
Posts: 65
Processes current user

ps -u $user -o user,pid,pcpu,comm

Processes all users

ps -e -o user,pid,pcpu,comm

Processes specific users

ps -u root,nobody -o user,pid,pcpu,comm

Sorry for the run around. I had forgotten about the "-u" option.

Last edited by beilstwh; 07-14-2004 at 12:42 PM.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
linux

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:13 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0