Linux 中 command not found 解决办法

 时间:2026-04-22 18:13:04

1、从图形界面启动 Linux 终端。

Linux 中 command not found 解决办法

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

Linux 中 command not found 解决办法

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

Linux 中 command not found 解决办法

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

Linux 中 command not found 解决办法

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

Linux 中 command not found 解决办法

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

Linux 中 command not found 解决办法

  • linux如何删除文件
  • cmd返回上一层目录是哪个命令
  • linux返回上一级目录的命令
  • vim怎么退出
  • linux中如何将文件内容复制到另一个文件中?
  • 热门搜索
    被蚊子咬了怎么消肿 自己交社保怎么交 单肩包怎么背 nervous怎么读 艾条怎么用 长痘痘了怎么消除 第二年车险怎么买 韧带拉伤怎么恢复 怎么让鼻子变挺 jeep指南者怎么样