Linux下解决“shutdown: command not found"问题
2015-02-07 22:09
465 查看
今天关机时,使用shutdown来执行此操作,但出现了一个"bash:shutdown:command not found"错误提示。这让我很困惑,这个命令在系统中是肯定存在的,但为什么会出现这种问题,经过查资料,发现是因为系统未找到该命令的所在路径。
对于此类问题的解决,需要查看命令的路径,然后修改环境变量配置文件.bash_profile。
首先查看shutdown命令的所在位置,即路径,输入语句whereis shutdown,找到其位置。
然后查看环境变量配置文件.bash_profile,其是用户的家目录文件下的一个隐藏文件,使用 ls -al即可查看。看一下PATH路径中是否包含之前查到的shutdown所在路径(正常情况下应该是没有)。在文件的最后加入PATH=$PATH:xxxx。其中,"xxxx"为shutdown的路径,这里注意,添加的是shutdown 的查找路径,不是绝对路径,不然是找不到的。即如果shutdown在/sbin/shutdown,那么xxxx就是/sbin。保存退出。
之后用source ~/.bash_profile执行一下文件。这样就可以正常使用shutdown了。
对于此类问题的解决,需要查看命令的路径,然后修改环境变量配置文件.bash_profile。
首先查看shutdown命令的所在位置,即路径,输入语句whereis shutdown,找到其位置。
然后查看环境变量配置文件.bash_profile,其是用户的家目录文件下的一个隐藏文件,使用 ls -al即可查看。看一下PATH路径中是否包含之前查到的shutdown所在路径(正常情况下应该是没有)。在文件的最后加入PATH=$PATH:xxxx。其中,"xxxx"为shutdown的路径,这里注意,添加的是shutdown 的查找路径,不是绝对路径,不然是找不到的。即如果shutdown在/sbin/shutdown,那么xxxx就是/sbin。保存退出。
之后用source ~/.bash_profile执行一下文件。这样就可以正常使用shutdown了。
相关文章推荐
- 解决linux下"bash:shutdown:command not found"的解决方法
- Linux问题解决:bash,shutdown command not found
- Linux中"command not found" 解决办法
- cmd "command not found"问题的真正原因和解决办法
- make install时"arm-linux-ranlib command not found"
- Linux启动时 Error 15: File not found 问题解决方法
- vnc Unable to licence server: "XML error 0:0 Error: First Tag not found"问题的解决
- 在Linux中解决command not found的方法
- "ld: library not found for -l...." 问题的解决
- [centos] Linux下"Device eth0 does not seem to be present,delaying initialization."问题解决方法.
- Linux/Centos5.5 Error: "-bash: telnet: command not found"
- Linux启动时 Error 15: File not found 问题解决方法
- (2010-06-15)Linux学习之问题一:bash: groupadd: command not found
- linux下使用shutdown命令关机,提示: -bash:shutdown:command not found
- "ld: library not found for -lz.1.2.3"的问题解决
- "ld: library not found for -l...." 问题的解决
- Bootstrap: command Tomcat 5.5\conf\server.xml" does not exist. eclipe启动tomcat问题解决方法
- "ld: library not found for -l...." 问题的解决
- bash: scp: command not found lost connection问题解决
- ubuntu 中制作init ramdisk 时候的mkinitrd的问题"mkinitrd command not found"