LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 05-29-2009, 11:15 AM   #1
Leo Simon
LQ Newbie
 
Registered: Aug 2004
Posts: 21

Rep: Reputation: 0
using ps with the u option and custom formatting


This should be trivial, but it's defeated me completely
I want to combine the u option with custom formating, specifically

I have a script that I'm running called doPingY,
Code:
ps aux | grep doPingY | grep -v grep
shows me that the program is running but all I want is the etime
Code:
ps -eo "%c %t"
gives me exactly the format I want, but it doesn't pick up my batch job. To see that I need the u option. But
Code:
ps -euo "%c %t"
produces a conflicting options error

Any advise would be most appreciated!!
 
Old 05-29-2009, 12:25 PM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,973
Blog Entries: 5

Rep: Reputation: 777Reputation: 777Reputation: 777Reputation: 777Reputation: 777Reputation: 777Reputation: 777
u requires you to specify a user on the command line. That means for it to work it has to be followed by a user name rather than other flags. Similarly o must be followed by options rather than other flags.

You can still do it but have to separate your flags:

ps -eu <username> -o "%c %t"
 
  


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
Creating custom headers to match a custom kernel utanja Debian 2 06-08-2007 03:15 PM
Custom kernel image on custom slack build using CUSS nykey Slackware 2 07-15-2006 03:05 AM
rpm have --nodeps option with dpkg is such an option available deepclutch Debian 2 03-26-2006 09:49 PM
custom install cd base-config custom mithereal Debian 6 09-11-2005 03:48 PM
custom geforce video card--custom module? bandofmercy Linux - Hardware 3 10-14-2004 06:52 PM


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

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