修改环境变量引起的bash 出错 解决方案
来源:互联网 发布:淘宝铠甲勇士烈焰刀 编辑:程序博客网 时间:2024/04/29 11:36
来自:http://www.iteye.com/wiki/blog/1244124
打开ubuntu 发现了 bash 的出错信息,如下,上网检索了一下 发现是环境变量有错误,找了多种方法 下面的方法是有效的一种。
错误信息
Command 'lesspipe' is available in the following places
* /bin/lesspipe* /usr/bin/lesspipe
The command could not be located because '/usr/bin:/bin' is not included in the PATH environment variable.
lesspipe: command not found
Command 'dircolors' is available in '/usr/bin/dircolors'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
dircolors: command not found
Command 'uname' is available in '/bin/uname'
The command could not be located because '/bin' is not included in the PATH environment variable.
uname: command not found
bash: [: !=: unary operator expected
bash: [: too many arguments
bash: [: too many arguments
bash: [: too many arguments
bash: [: =: unary operator expected
bash: [: too many arguments
bash: [: too many arguments
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
Command 'sed' is available in '/bin/sed'
The command could not be located because '/bin' is not included in the PATH environment variable.
sed: command not found
bash: [: too many arguments
bash: [: =: unary operator expected
bash: [: too many arguments
bash: [: too many arguments
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
ema@ubuntu:~$ sudo vi /usr/bin/vi ~/.bashrc
Command 'sudo' is available in '/usr/bin/sudo'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
sudo: command not found
ema@ubuntu:~$ LS
The program 'LS' is currently not installed. You can install it by typing:
sudo apt-get install sl
ema@ubuntu:~$ ls
Command 'ls' is available in '/bin/ls'
The command could not be located because '/bin' is not included in the PATH environment variable.
ls: command not found
ema@ubuntu:~$ sudo vi /usr/bin/vi ~/.bashrc
Command 'sudo' is available in '/usr/bin/sudo'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
sudo: command not found
ema@ubuntu:~$ echo $PATH
/opt/program/mx53_smd/out/host/linux-x86/binPATH
ema@ubuntu:~$ export PATH=/usr/bin/:$PATH
ema@ubuntu:~$ ls
Command 'ls' is available in '/bin/ls'
The command could not be located because '/bin' is not included in the PATH environment variable.
ls: command not found
ema@ubuntu:~$ sudo gedit /root/.bash_profile
[sudo] password for ema:
ema@ubuntu:~$ su -root
Command 'su' is available in '/bin/su'
The command could not be located because '/bin' is not included in the PATH environment variable.
su: command not found
ema@ubuntu:~$ sudo su
Command 'lesspipe' is available in the following places
* /bin/lesspipe
* /usr/bin/lesspipe
The command could not be located because '/usr/bin:/bin' is not included in the PATH environment variable.
lesspipe: command not found
Command 'dircolors' is available in '/usr/bin/dircolors'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
dircolors: command not found
root@ubuntu:/home/ema# echo $PATH
/usr/local/arm/arm-2009q1/bin:/opt/program/mx53_smd/out/host/linux-x86/binPATH
root@ubuntu:/home/ema# env
Command 'env' is available in '/usr/bin/env'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
env: command not found
root@ubuntu:/home/ema# gedit /root/.bashrc
Command 'gedit' is available in '/usr/bin/gedit'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
gedit: command not found
root@ubuntu:/home/ema# pwd
/home/ema
root@ubuntu:/home/ema# cd /
root@ubuntu:/# ls
Command 'ls' is available in '/bin/ls'
The command could not be located because '/bin' is not included in the PATH environment variable.
ls: command not found
root@ubuntu:/# pwd
解决方案:切换到root 然后执行以下命令
root@ubuntu:/# /usr/bin/sudo -i
root@ubuntu:~# /usr/bin/nano /etc/bash.bashrc
把bashrc文件中添加的错误信息 去掉
比如我的bashrc文件中
最后一行 export PATH=/opt/program/mx53_smd/out/host/linux-x86/binPATH
把此行去掉bash功能恢复。
0 0
- 修改环境变量引起的bash 出错 解决方案
- bash可修改的环境变量
- 修改环境变量导致命令出错
- Bash 的环境变量
- Bash的环境变量
- bash只读的环境变量
- linux的bash环境变量
- Bash的环境变量
- bash PS1环境变量的设置
- bash shell 下的环境变量
- Bash相关的环境变量配置
- bash环境变量的简单总结
- bash的expr 0会引起退出?
- Bash玩转脚本5之Windows上修改环境变量的脚本系统
- Bash玩转脚本5之Windows上修改环境变量的脚本系统
- macOS 修改bash环境变量PATH及自建脚本直接输入脚本名执行的方法
- Windows环境变量过长及修改环境变量后导致的不能开机解决方案
- 杀毒软件引起的WinCE编译出错问题
- 树状数组的理解
- 2.2-2 选择排序
- 说说Android桌面(Launcher应用)背后的故事(大结局)——让Widget拥有Application同等的待遇
- 左右滑动动画切换屏幕
- Ogre 整体框架入门
- 修改环境变量引起的bash 出错 解决方案
- Cortex-A8按键中断程序
- POJ 2479 Maximum sum
- 云计算简介
- 简单说说iOS的图形和动画
- 20140331心情
- 黑马程序员-有关List集合的总结
- 用keil编译LPC程序
- openssl在多平台和多语言之间进行RSA加解密注意事项