Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 05-29-2009, 12:15 PM   #1
Leo Simon
LQ Newbie
Registered: Aug 2004
Posts: 22

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,
ps aux | grep doPingY | grep -v grep
shows me that the program is running but all I want is the etime
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
ps -euo "%c %t"
produces a conflicting options error

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

Rep: Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847
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"


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

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

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