• Post Reply Bookmark Topic Watch Topic
  • New Topic

ps  RSS feed

 
eric sato
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
how to i list all the process id, but without own process it using 'grep'
[something$]ps -ef |grep cvs
kh 18426 18420 91 19:02 pts/0 00:00:05 /usr/java/cvs
kh 18442 18263 0 19:02 pts/0 00:00:00 grep cvs

i want only the result return only the first line without my own 'grep' proces id. thanks in advance
sato
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you could say
ps -ef | grep cvs | grep -v grep
Or you could use the "pgrep" utility (part of the procps package, found on most Linux systems) and say
pgrep -lf cvs
which would just print
18426 /usr/java/cvs
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!