LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Grep help needed (https://www.linuxquestions.org/questions/linux-newbie-8/grep-help-needed-78670/)

Dirt 08-03-2003 05:10 PM

Grep help needed
 
I need to grep out a process... for example.. if I do

$ ps -ef


This is what is shows...

root 1091 1 0 16:42 ? 00:00:00 esd -terminate -nobeeps -as 2 -spawnfd 22
root 1100 1 0 16:42 ? 00:00:03 gnome-panel --sm-client-id default2
root 1102 1 0 16:42 ? 00:00:03 nautilus --no-default-window --sm-client-id default3
root 1104 1 0 16:42 ? 00:00:00 magicdev --sm-client-id default4


Say I needed to grep out the process wtih 'default3' in it. I thought I could just do.

ps -ef | grep default3

This returns nothing. However is I change it to

ps -ef | grep nautilus

it returns the process fine. How can I get it to grep the stuff after the file name? Any ideas?

:newbie:

Thanks,
Dirt

jqcaducifer 08-03-2003 05:16 PM

Put quotes around the default3 thing. (and are you sure it exists? because if it doesn't exist it won't display either).

martinman 08-03-2003 05:18 PM

default3 isnt a real service or program, just a tagged on attribute of nautilus. go with the quotes

Dirt 08-03-2003 05:30 PM

No luck. :( Thanks guys I tried the quotes but still no luck.... I get

root 1419 1156 0 17:31 pts/0 00:00:00 grep default3

Any more ideas? Ill try anything.

Dirt 08-03-2003 05:49 PM

Ok, I figured out its a character length problem. For some reason when you grep it, it cuts the character length down to about 50 characters for the CMD column and everything after that is cropped. Is there a way to change this?

Dirt


All times are GMT -5. The time now is 12:18 PM.