ps -ef | egrep 'http|ssh' > > ps -ef | grep ssh AND apache > > > > or similar. > Can you explain more? As others have said you probably want and OR > match as grep uses line breaks as field delimiters. The above suggestion should suffice? -- Abhinav Keswani