ls,sudo commands not found (shell commands)

亡梦爱人 提交于 2019-12-24 07:10:06

问题


I tried to install laravel Framework in my mac OSX 10 .And I ended modifying my ~/.bash_profile to add the laravel command. laravel command seems to work normally .But another problem came out . ls ,sudo ...and other shell commands does not work .

-bash: ls: command not found

My bash.profile file contains the two links

export PATH="/Applications/MAMP/bin/php/php5.6/bin"
export PATH="$PATH:$HOME/.composer/vendor/bin"

回答1:


check in ~/.bash_profile if this PATHs exist

export PATH=/opt/local/bin:/opt/local/sbin:$PATH

your complete line should looks like this

export PATH=/Applications/MAMP/bin/php/php5.6/bin:$HOME/.composer/vendor/bin:/opt/local/bin:/opt/local/sbin:$PATH

reboot needed.




回答2:


The binaries for the above mentioned utilities for debian distribution are usually in /bin or /usr/bin directory. Of course exporting path won't help if the binaries are not there.

There could be one simple approach to it -

  • Check for the location of binaries and then export the path in the bash_profile or .bashrc.

  • Run the bashrc script (. ~/.bashrc) following you may not require a reboot.



来源:https://stackoverflow.com/questions/42872332/ls-sudo-commands-not-found-shell-commands

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!