I am trying to execute the gpustat command after SSHing into a remote server.

I am using z-shell + oh-my-zsh.

I put the gpustat command into my .zshrc file.

However, after logging in, I get the error message:

command not found: gpustat

What I find confusing is that when I source the .zshrc file, the gpustat command is executed and works.

1 Answer 1


It looks like you're trying to run gpustat in your .zshrc file before it has been added to your $path. My guess is that its added to your path somewhere later in your .zshrc, which would explain why it works when you source your .zshrc file manually: At that point, your whole .zshrc file has already been sourced once and gpustat has been added to your $path at that point.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .