查看:

echo $PATH

添加:

方法一:

export “yourPath1:yourPath2:$PATH”

注意:该方法在终端关闭后会失效,所以建议通过编辑/etc/profile来改PATH,或者也可以修改home目录下的.bashrc文件添加。

方法二:

vim /etc/profile
文件最后添加:export “yourPath1:yourPath2:$PATH”
保存、退出。
运行:source /etc/profile 不报错。则成功。

方法三:

修改~/.bashrc文件,方法同上

相关文章:

  • 2021-10-10
  • 2021-12-23
  • 2021-12-28
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-15
  • 2021-12-05
  • 2021-09-01
  • 2022-01-11
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案