Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

commands not found on zsh

People also ask

How do I find ZSH commands?

To use it, press CTRL + R in your terminal session. This will change your terminal session to search mode, and you can type for previous commands. As you type, the shell will search for a matching command in the history and suggest it. To search for the next matching suggestion, press CTRL + R.

How do I add a command to ZSH?

On Ubuntu-based distros, you can install zsh using: sudo apt-get install zsh . Once the installation completes, you can check the version using zsh --version , then make zsh your default shell using chsh -s $(which zsh) . You'll need to log out, then log back in for the changes to take effect.


It's evident that you've managed to mess up your PATH variable. (Your current PATH doesn't contain any location where common utilities are located.)

Try:

PATH=/bin:/usr/bin:/usr/local/bin:${PATH}
export PATH

Alternatively, for "resetting" zsh, specify the complete path to the shell:

exec /bin/zsh

or

exec /usr/bin/zsh

In your ~/.zsh config file include the path to your bash path file that contains your aliases. In my case it was including the line "source ~/.bash_profile" inside of ~/.zsh .


  1. Use a good text editor like VS Code and open your .zshrc file (should be in your home directory. if you don't see it, be sure to right-click in the file folder when opening and choose option to 'show hidden files').

  2. find where it states: export PATH=a-bunch-of-paths-separated-by-colons:

  3. insert this at the end of the line, before the end-quote: :$HOME/.local/bin

And it should work for you.

You can test if this will work first by typing this in your terminal first: export PATH=$HOME/.local/bin:$PATH

If the error disappears after you type this into the terminal and your terminal functions normally, the above solution will work. If it doesn't, you'll have to find the folder where your reference error is located (the thing not found), and replace the PATH above with the PATH-TO-THAT-FOLDER.


On MacOS BigSur Click Terminal >> Preferences change the from /bin/zsh to /bin/bash Close and reopen the terminal

FROM Preference screen before

TO Preference screen after

You can now go back to .zshrc file to revert the last change you made


I fixed the issue by opening the terminal preference general tab and changing the Command (complete path) to /bin/bash to default and then editing the ~/.zshrc file.

enter image description here

export PATH="all your path inside the quotes"

...without any whitespace between the PATH=" and save the file.

enter image description here

After saving the file, change the /bin/zsh in your command or select default enter image description here

...and restart terminal and you should have your zsh shell working again!