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?
漂亮男人2017-05-16 16:38:05
Your PATH must be misconfigured somewhere. Post the relevant lines in .zshrc that configure PATH
某草草2017-05-16 16:38:05
Check whether your zsh is installed and see if there is a .zshrc file in the path
天蓬老师2017-05-16 16:38:05
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.
世界只因有你2017-05-16 16:38:05
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梦2017-05-16 16:38:05
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.