# Why does my ps not work



## tdenson (Oct 3, 2002)

Whenever I run ps from a telnet session on my Tivo I get nothing, it just comes back to the bash prompt. I can't even induce an error message by giving it nonsense options. What's going on ?


----------



## Verne (Nov 21, 2000)

Are you just typeing "ps" on its own? Try "ps aux" instead.

Where is your ps installed, /var/hack/bin? Is that in your PATH? Try running it from that directory if it's not.

Are you sure you transferred it in binary mode?

If you've got ls installed do "ls -l /var/hack/bin/ps" and post back what it lists. Is it executable?

Can't think of anything else to try. Hope this helps.


----------



## tdenson (Oct 3, 2002)

Verne said:


> Are you just typeing "ps" on its own? Try "ps aux" instead.
> 
> Where is your ps installed, /var/hack/bin? Is that in your PATH? Try running it from that directory if it's not.
> 
> ...


Thanks. It runs properly when I run it from /var/hack/bin - I must have a rogue copy in my path somewhere.


----------



## tdenson (Oct 3, 2002)

I now have a further oddity. There was a zero byte version in /var/hack which I have removed, however now when I just type ps I get -

bash: /var/hack/ps: No such file or directory

But if I type /var/hack/bin/ps it works.


----------



## healeydave (Jun 4, 2003)

you've answered your own question.

You had a duff ps at 0 bytes in /var/hack which you have now deleted hence the no such file or directory message.

The working version works from /var/hack/bin

Your .profile probably requires you to add the /var/hack/bin directory to your PATH statement so that you can run ps from elsewhere other than just the /var/hack/bin directory.

I suspect you have an exisitng path setup for /var/hack but not /var/hack/bin


----------



## tdenson (Oct 3, 2002)

healeydave said:


> you've answered your own question.
> 
> You had a duff ps at 0 bytes in /var/hack which you have now deleted hence the no such file or directory message.
> 
> ...


No, I think you misunderstood what I said. The error you get if a program is not in the path is "command not found". I do have /var/hack/bin in my path, but if I run it without prefixing ps with /var/hack/bin I get "no such file or directory". This is *not* the error you get if it can't find ps.


----------



## tdenson (Oct 3, 2002)

Now rebooted and al is well, I think something was lurking.


----------



## aerialplug (Oct 20, 2000)

Bash caches the path.

(that sounds cool)


----------

