![无法在 Ubuntu 16.04 LTS 中打开 Bashrc](https://linux22.com/image/1152614/%E6%97%A0%E6%B3%95%E5%9C%A8%20Ubuntu%2016.04%20LTS%20%E4%B8%AD%E6%89%93%E5%BC%80%20Bashrc.png)
我无法在 ubuntu 中打开 bashrc 文件。我尝试使用gedit ~/.bashrc
vi 命令,但无法打开。
当我每次打开终端时,它都会显示类似的问题
bash: export: `/opt/grads-2.1.0.oga.1/Contents/Resources/SampleDatasets :/usr/local/ferret/bin:/home/user/bin:/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin': not a valid identifier
运行后.profile
,我遇到了类似的问题
user@revathi:~$ . ~/.profile
bash: lesspipe: No such file or directory
bash: dircolors: No such file or directory
bash: ls: No such file or directory
bash: grep: No such file or directory
bash: export: `/opt/grads-2.1.0.oga.1/Contents/Resources/SampleDatasets :/usr/local/ferret/bin:': not a valid identifier
有人可以帮我修复路径吗?
答案1
您更改了 PATH 变量并添加了空格,这会妨碍系统找到关键程序。gedit
使用完整路径调用
/usr/bin/gedit ~/.bashrc
并更正错误。我怀疑您的错误行如下所示:
PATH="/opt/grads-2.1.0.oga.1/Contents/Resources/SampleDatasets :$PATH"
虽然应该
PATH="/opt/grads-2.1.0.oga.1/Contents/Resources/SampleDatasets:$PATH"
然后保存文件,使用 source 命令. ~/.bashrc
或者打开一个新终端,你的终端就会恢复正常。