我在访问我的~/.bashrc文件时遇到问题。我做了并获得了以下内容:
yuve@YuveSys:~$ ~/.bashrc
-bash: /home/yuve/.bashrc: Permission denied
yuve@YuveSys:~$ sudo su
root@YuveSys:/home/yuve# ~/.bashrc
bash: /root/.bashrc: Permission denied
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮忙吗?
注意:我使用的是 Ubuntu 14.04 LTS。谢谢。
.bashrc不是要执行,而是要采购。试试这个:
. ~/.bashrc
Run Code Online (Sandbox Code Playgroud)
编辑文件运行 nano .bashrc
希望能帮助到你
如果您尝试打开.bashrc文件进行编辑,则需要使用任何文本编辑器打开它,例如 nano、vi 或 gedit。如果您在以任何方式更改后尝试更新,您可以使用source .bashrc命令。
例如,
# Open the file with nano text editor and make changes you want
$ nano ~/.bashrc
# Run source command to apply changes
$ source ~/.bashrc
foobar@ubuntu:$
Run Code Online (Sandbox Code Playgroud)
也可以看看: