linux终端出现bash: setup.bash: No such file or directory,和.bashrc文件的问题
2015-04-06 10:51
627 查看
前段时间linux中打开终端时,总是出现bash: /opt/ros/indig/setup.bash: No such file or directory的问题。此问题跟每次终端打开时要加载的bash有关,于是查bash的相关文档知道了:
/etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行,并从/etc/profile.d目录的配置文件中搜集shell的设置.
/etc/bashrc:为每一个运行bash
shell的用户执行此文件.当bash shell被打开时,该文件被读取.
~/.bash_profile:每个用户都可使用该文件输入专用于自己使用的shell信息,当用户登录时,该文件仅仅执行一次!默认情况下,他设置一些环境变量,执行用户的.bashrc文件.
~/.bashrc:该文件包含专用于你的bash
shell的bash信息,当登录时以及每次打开新的shell时,该文件被读取.
~/.bash_logout:当每次退出系统(退出bash
shell)时,执行该文件.
我挨个地打开这些文件,最后在~/.bashrc这个文件的最后一行发现了:source
/opt/ros/indig/setup.bash 而这个bash文件在文件系统中是不存在的,于是我把它删掉。之后再启动终端时就正常了。
另:我们可以通过
命令来把某个路径加入.bashrc文件。
然后通过
命令来把使其生效。
/etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行,并从/etc/profile.d目录的配置文件中搜集shell的设置.
/etc/bashrc:为每一个运行bash
shell的用户执行此文件.当bash shell被打开时,该文件被读取.
~/.bash_profile:每个用户都可使用该文件输入专用于自己使用的shell信息,当用户登录时,该文件仅仅执行一次!默认情况下,他设置一些环境变量,执行用户的.bashrc文件.
~/.bashrc:该文件包含专用于你的bash
shell的bash信息,当登录时以及每次打开新的shell时,该文件被读取.
~/.bash_logout:当每次退出系统(退出bash
shell)时,执行该文件.
我挨个地打开这些文件,最后在~/.bashrc这个文件的最后一行发现了:source
/opt/ros/indig/setup.bash 而这个bash文件在文件系统中是不存在的,于是我把它删掉。之后再启动终端时就正常了。
另:我们可以通过
echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc
命令来把某个路径加入.bashrc文件。
然后通过
source ~/.bashrc
命令来把使其生效。
相关文章推荐
- 执行文件下载Java 调用 FFMPEG 命令时用 url 作为输入源,Linux 下出现 “no such file or directory” 问题的解决
- ubuntu下如何处理出现“ unable to execute ./DrClientLinux: No such file or directory”,“没有那个文件或目录”的问题。
- Linux执行.sh文件,提示No such file or directory的问题的解决方法
- Linux执行.sh文件,提示No such file or directory的问题的解决方法
- Linux执行.sh文件,提示No such file or directory的问题的解决方法
- Linux下运行可执行文件出现no such file or directory
- linux 出现bash: ****: /lib64/ld-linux-x86-64.so.2: bad ELF interpreter: No such file or directory
- 关于STM32头文件包含出现No such file or directory和 invalid redeclaration of type name...的问题
- Linux执行.sh文件,提示No such file or directory的问题
- 在编译CUDA程序时出现 fatal error C1083: 无法打开包括文件:“cutil.h”: No such file or directory 的问题
- Linux执行.sh文件,提示No such file or directory的问题的解决方法
- 交叉编程的程序移植到开发板上出现bash: xxx: No such file or directory的问题
- 关于STM32头文件包含出现No such file or directory和 invalid redeclaration of type name...的问题
- 在android系统命令行中执行arm linux程序,出现/system/bin/sh: .xxx No such file or directory问题
- Linux执行.sh文件,提示No such file or directory的问题
- Linux执行.sh文件,提示No such file or directory的问题的解决方法
- Linux执行.sh文件,提示No such file or directory的问题的解决方法
- sed—在linux 中执行脚本的时候出现: /bin/bash^M: bad interpreter: No such file or directory
- UNIX/Linux下运行脚本文件出现bad interpreter:No such file or directory的原因和解决办法
- Java 调用 FFMPEG 命令时用 url 作为输入源,Linux 下出现 “no such file or directory” 问题的解决