首页 > 游戏数码 > 电脑 > Linux 中 command not found 解决办法

Linux 中 command not found 解决办法

   来源:秒知站    阅读: 3.11W 次
字号:

用手机扫描二维码 在手机上继续观看

手机查看

安装好 Linux 系统后,其他一切正常,却在终端无法执行某些命令(如 shutdown 等),屏幕显示错误为 command not found。那么,该如何解决这个问题呢?下面就来教大家解决问题的方法。

操作方法

(01)从图形界面启动 Linux 终端。

Linux 中 command not found 解决办法

(02)在命令行输入 su,回车。然后输入 root 用户密码(注意,屏幕上不显示),回车,登入 root 用户。

Linux 中 command not found 解决办法 第2张

(03)在命令行输入 gedit /etc/profile,回车。这样就打开了一个文本编辑器对 profile 文件进行编辑。

Linux 中 command not found 解决办法 第3张

(04)在文件的最末一行,添加 PATH=$PATH:/sbin,然后保存并关闭文件。注意,务必记得保存文件。

Linux 中 command not found 解决办法 第4张

(05)在命令行继续输入 source /etc/profile ,回车,使刚才更改后的配置文件生效。注意,etc 前面的 / 不能少。

Linux 中 command not found 解决办法 第5张

(06)现在,一切大功告成。马上试着执行 shutdown -h now 关机命令,是不是没有错误提示了?

Linux 中 command not found 解决办法 第6张

特别提示

shutdown 关机命令必须要 root 用户才能执行,普通用户无法执行该命令。

电脑网络
IT技术
互联网
电脑
摄影
手机
游戏