LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-03-2003, 05:10 PM   #1
Dirt
Member
 
Registered: Feb 2002
Location: St. Louis
Distribution: Red Hat 8.0
Posts: 30

Rep: Reputation: 15
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?



Thanks,
Dirt
 
Old 08-03-2003, 05:16 PM   #2
jqcaducifer
Member
 
Registered: Jul 2003
Distribution: Fedora 3
Posts: 133

Rep: Reputation: 15
Put quotes around the default3 thing. (and are you sure it exists? because if it doesn't exist it won't display either).
 
Old 08-03-2003, 05:18 PM   #3
martinman
Member
 
Registered: Apr 2003
Distribution: Gentoo 1.4
Posts: 290

Rep: Reputation: 30
default3 isnt a real service or program, just a tagged on attribute of nautilus. go with the quotes
 
Old 08-03-2003, 05:30 PM   #4
Dirt
Member
 
Registered: Feb 2002
Location: St. Louis
Distribution: Red Hat 8.0
Posts: 30

Original Poster
Rep: Reputation: 15
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.

Last edited by Dirt; 08-03-2003 at 05:31 PM.
 
Old 08-03-2003, 05:49 PM   #5
Dirt
Member
 
Registered: Feb 2002
Location: St. Louis
Distribution: Red Hat 8.0
Posts: 30

Original Poster
Rep: Reputation: 15
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
 
  


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
grep ?? can grep us variables? DaFrEQ Linux - Software 4 09-14-2005 12:22 PM
grep option needed ziox Linux - General 7 01-04-2005 11:02 PM
What does rpm -qa |grep th* (as compared to rpm -qa |grep th) display? davidas Linux - Newbie 2 03-18-2004 01:35 AM
"Undeleting" data using grep, but get "grep: memory exhausted" error SammyK Linux - Software 2 03-13-2004 03:11 PM
ps -ef|grep -v root|grep apache<<result maelstrombob Linux - Newbie 1 09-24-2003 11:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:54 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration