ps-eo returning wrong value

Hi
Need some help, bit of a noobie here.

This command work perfectly with unix. returns a value of 1 which is what i want.
ps -eo user,comm |grep -v grep |grep -c /path to file

When i run the same command on a linux server it returns a value of 0.,
something maybe wrong with the command. The process im looking for is definately running. Just returns a value of 0

someone please help

I don't know which flavor of unix you are used to using so I can't give you a direct translation. Switches for the various standard unix/linux commands vary between distributions. Check the man pages for the command to find the switch that provides the output you are looking for.

Try this one.
ps -eo user,comm |grep -v grep |grep -c filename

e.g:

ps -eo user,comm |grep -v grep |grep -c sshd

It's possible that the options that you're trying to use are from the BSD version of ps. If that's the case, you may be able to try using it without the '-' in front of the 'eo' options and see if that provides the output you're expecting.

As per the ps man page:

This version of ps accepts several kinds of options:
1 UNIX options, which may be grouped and must be preceded by a dash.
2 BSD options, which may be grouped and must not be used with a dash.
3 GNU long options, which are preceded by two dashes.

Hope this helps!

I think you need to use:

ps -eo user,args

instead.