grep command - excat pattern

Hi,
I wanna use grep command to search the excat pattern.
For eg. I want to do ps -ef | grep '6710'
It should not display other than the process id 6710. i.e) It should not display 26710,16710 etc.,

Thanking u.

grep -w 6710

grep -w word

will show you too the entire line ! If you want to only see the pid, use ps to show you only the pid with this command :

ps -e -o pid

and then if you do your grep, it, of course, will only show you the process id !