commands not found on zsh

前端 未结 16 1565
梦毁少年i
梦毁少年i 2020-12-04 06:30

I am using the z Shell (zsh) instead of the default bash, and something wrong happen so that all commands who used to work are no longer recognized:

<         


        
相关标签:
16条回答
  • 2020-12-04 07:14

    You can create a symlink in /usr/local/bin/

    sudo ln -s $HOME/.composer/vendor/bin/homestead /usr/local/bin/homestead
    
    0 讨论(0)
  • 2020-12-04 07:18

    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!

    0 讨论(0)
  • 2020-12-04 07:24

    Best solution work for me for permanent change path

    Open Finder-> go to folder /Users/ /usr/local/bin

    open .zshrc with TextEdit

    .zshrc is hidden file so unhide it by command+shift+. press

    delete file content and type

    export PATH=~/usr/bin:/bin:/usr/sbin:/sbin:$PATH

    and save

    now

    zsh: command not found Gone

    0 讨论(0)
  • 2020-12-04 07:28

    My solution:

    Change back to bash:

    source .bashrc
    

    next:

    echo $PATH
    

    copy this:

    /home/frank/.asdf/shims:/home/frank/....
    

    back to the zsh:

    source .zsh
    

    open .zshrc:

    and paste:

     export PATH=/home/frank/.asdf/shims:/home/frank/....
    

    restart terminal

    0 讨论(0)
提交回复
热议问题