lin@lenovo:~$ su - root
口令:
Command "mesg" is available in "/usr/bin/mesg"
The command could not be located because "/usr/bin" is not included in the PATH environment variable.
-su: mesg:找不到命令
root@lenovo:~# gedit /etc/profile
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.
-su: gedit:找不到命令
root@lenovo:~# useradd yul
Command "useradd" is available in "/usr/sbin/useradd"
The command could not be located because "/usr/sbin" is not included in the PATH environment variable.
This is most likely caused by the lack of administrative priviledges associated with your user account.
-su: useradd:找不到命令
root@lenovo:~# vi
Command "vi" is available in "/usr/bin/vi"
The command could not be located because "/usr/bin" is not included in the PATH environment variable.
-su: vi:找不到命令问题分析及解决办法:这主要是路径问题,先查看$PATH变量的设置。
echo $PATH
里面的格式是xxx:xxx:xxx:xxx
这应该没包含/usr/bin这个路径。
执行下面命令就可以将这个路径包含进去:
export PATH=/usr/bin/:$PATH
如果要想每次登陆系统的时候,都自动包含这个路径,
可以把刚才这个命令加入到/root/.bash_profile或者/root/.bashrc文件的后面。具体如下:
退回到普通用户(我的普通用户是lin)
lin@lenovo:~$ sudo gedit /root/.bash_profile
添加export PATH=/usr/bin/:$PATH,保存关闭.bash_profile文件
lin@lenovo:~$ su - root
口令:
root@lenovo:~# echo $PATH
/usr/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/binroot@lenovo:~# env
SHELL=/bin/bash
TERM=xterm
XDG_SESSION_COOKIE=f591adb565a6ba1bc40f9e954a26895b-1255053756.679619-1536901825
USER=root
MAIL=/var/mail/root
PATH=/usr/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/root
LANG=zh_CN.UTF-8
SHLVL=1
HOME=/root
LANGUAGE=zh_CN:zh
LOGNAME=root
_=/usr/bin/envroot@lenovo:~# vi
就可进行vi编辑了。在Ubuntu中安装工具AutotoolsFedora 11 yum 源相关资讯 Ubuntu知识
- Ubuntu 有这功能吗?-回答4个新用 (10/14/2014 16:54:49)
- Ubuntu小知识总结 (07/08/2013 17:02:10)
- 万圣节Halloween与Ubuntu (10/31/2012 07:59:01)
| - Ubuntu系统诞生10周年:让Linux更 (10/14/2014 16:53:00)
- Ubuntu 官方发布 Ubuntu 应用程序 (02/15/2013 21:49:58)
- Ubuntu内置捐款选项:为掌握用户需 (10/11/2012 13:57:23)
|
本文评论 查看全部评论 (0)