vim - mac command line does not execute
黄舟
黄舟 2017-05-16 16:36:05
0
5
653

After executing source ~/.zshrc in the command line, you can only use the cd command. Other ls, vim... cannot be used, and the error zsh: command not found: ls will be reported. How to solve this?

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(5)
漂亮男人

Your PATH must be misconfigured somewhere. Post the relevant lines in .zshrc that configure PATH

某草草

Check whether your zsh is installed and see if there is a .zshrc file in the path

Peter_Zhu

Check the $PATH variable

$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

For example, the directory where ls is located:

$ whereis ls
/bin/ls

If it does not exist in $PATH/bin/, the ls command will not be recognized.

世界只因有你

Put a copy of the path in your default bash into zsh as well

cat .zshrc
vim .zshrc 
增加:
export PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
过去多啦不再A梦

The person above is right, there is a problem with PATH.
.zshrc generally adds directories to PATH:

export PATH=$PATH:$YOUR_FOLDER/bin

If you accidentally write:

export PATH=$YOUR_FOLDER/bin

The situation you mentioned will occur.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!