LinuxQuestions.org
Review your favorite Linux distribution.
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-28-2005, 11:35 PM   #1
hardian_97
LQ Newbie
 
Registered: Jul 2005
Location: Indonesia
Posts: 23

Rep: Reputation: 15
using ps command without listing ps itself


Hi All,

I would like to know, how can we use ps command without listing the process of ps itself. Cause i would like to write shell script using ps, but it is also listing the ps process itself.

Thank you for your time.

With kind regards,
Hardian_97
 
Old 08-28-2005, 11:42 PM   #2
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 60
i wouldnt think there would be a way to do this.. of course i can definetly be wrong though.

the purpose of linux is to have the kernel to control the hardware.. and have TONS of tiny programs to do 'one task, and do it well'. the purpose of ps is to list all running processes. it wouldnt be doing its job if it didnt list the ps process which you run.

edit: :O after briefly browsing the man page (the above was a guess, and i guess this is too as im not in linux to test) look at all the options.. you might be able to use a combination of the '--deselect' option along with the -C option to list only a certain command name.. i dunno, test it out, or fool around with it. good luck.

Last edited by nadroj; 08-28-2005 at 11:47 PM.
 
Old 08-29-2005, 12:44 AM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
ps -A| egrep -ve "(ps|egrep)"


Cheers,
Tink
 
Old 08-29-2005, 01:57 AM   #4
hardian_97
LQ Newbie
 
Registered: Jul 2005
Location: Indonesia
Posts: 23

Original Poster
Rep: Reputation: 15
Hi tinkster and nadroj,

Thank you for your input and it worked just as I wanted.

With kind regards,
Hardian_97
 
  


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
Apache2 listing colabus Linux - Software 1 11-09-2005 07:51 PM
listing users... spotass Linux - Newbie 1 06-12-2004 03:18 AM
long listing using ls -l command display year or time of the file mnd_world Linux - Newbie 1 05-20-2004 12:39 PM
listing of package x2000koh Debian 3 07-29-2003 07:52 AM
Listing user IP Silversun Linux - Newbie 4 08-20-2002 12:31 PM

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

All times are GMT -5. The time now is 06:16 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration