解决linux下"bash:shutdown:command not found"的解决方法
来源:互联网 发布:软件开发企业税收优惠 编辑:程序博客网 时间:2024/05/16 18:28
在学习使用linux过程中,发现一个问题,当我使用su命令成为超级用户的时候,使用shutdown来关机或重启时,会给我一个"bash:shutdown:command not found"
在网上找了挺多的解决方法,终于解决了。现在把方法留下。
首先我们要知道为什么会出现这种问题:首先这个命令是一定存在的,现在找不到,估计是寻找的路径不对。所以我们要看看root用户的环境变量。
先切到root, su -
这里要求输入root的密码
输入 whereis shutdow
找到shutdown的位置
然后查看root用户的环境变量
输入 echo $PATH
看一下shutdown的路径在不在PATH中
不在的话就输入export PATH=$PATH:xxxx
"xxxx"为shutdown的路径,这里注意,添加的是shutdown 的查找路径,不是绝对路径,不然是找不到的。
即如果shutdown在/sbin/shutdown
那么xxxx就是/sbin
上面这样的修改一重启后就不能用了。所以我们要用
vim ~/.bash_profile 然后再文件的后面添加PATH=$PATH:/sbin,然后保存退出。
之后用source ~/.bash_profile。以后就可以一直用你的shutdown了。
接下来就可以运行shutdown了
2 0
- 解决linux下"bash:shutdown:command not found"的解决方法
- linux下 bash:command not found解决方法
- Linux问题解决:bash,shutdown command not found
- linux下使用shutdown命令关机,提示: -bash:shutdown:command not found
- centos下bash: XXX: command not found的解决方法
- Linux -bash: java: command not found 解决方法
- linux下 的command not found解决
- Linux解决bash: mysql: command not found 的方法
- -bash: pecl: command not found的解决方法
- -bash: pecl: command not found的解决方法
- bash: mail: command not found的解决方法
- bash scp command not found的解决方法
- 虚拟机linux环境下编译程序时出现 bash:gcc:command not found的解决
- linux下提示 -bash: ******* :command not found
- linux下提示bash:command not found
- linux下提示bash:command not found
- linux下提示bash:command not found
- linux下提示bash:command not found
- 第10周 hadoop与关系型数据库交换数据
- 算法经典书籍推荐
- java Socket的选项
- 挨踢职场求生法则-----我在IT职场打滚超过15年了,从小小的程序员做到常务副总
- .NET月薪10K的王同学:把面试官当作中意的妞,想办法取悦他!
- 解决linux下"bash:shutdown:command not found"的解决方法
- css中选择器总结
- Transformations between ECEF and ENU coordinates
- 小强的HTML5移动开发之路(25)—— AppCan开发环境
- UVA 11468-Substring(AC自动机+概率dp)
- c/c++ 调用QuickTime API中的细节问题
- LEADTOOLS使用教程及资源汇总
- javascript Date format(js日期格式化)
- oracle的用户授权问题:如何把一个用户的所有表的读写权限授予另一个用户