.bashrc:权限被拒绝 [英] .bashrc: Permission denied
问题描述
我尝试在一个无所事事的项目中工作.
我已经发出命令vagrant ssh
,并连接到VM.现在,我需要编辑.bashrc
文件以设置源代码的路径.但是首先我找不到那个文件.因此,我搜索了一下,发现方法是调用命令~/.bashrc
.但是这样做,我得到一条消息,说我无权访问它:
I try to work with a project in vagrant.
I have made the command vagrant ssh
, and connected to VM. Now I need to edit .bashrc
file to set path to the source code. But first I couldn't find that file. So I googled and find that the way is call command ~/.bashrc
. But doing this I get message, that I have no access to it:
[vagrant@nupic-vagrant:~]$ ~/.bashrc
-bash: /home/vagrant/.bashrc: Permission denied
那现在该怎么办?
UPD.
我找不到.bashrc文件.
当我尝试发出命令ls -a
时,我得到以下提示:
UPD.
I can't find the .bashrc file.
When I try to make command ls -a
I get following:
[vagrant@nupic-vagrant:~]$ ls -a
. .bash_logout cleanup.sh sshd.sh .veewee_params
.. .bash_profile minimize.sh vagrant.sh .veewee_version
.bash_history .bashrc .ssh .vbox_version .zsh_profile
[vagrant@nupic-vagrant:~]$ locate .bashrc
/etc/skel/.bashrc
/home/vagrant/.bashrc
/var/chef/backup/etc/skel/.bashrc.chef-20130614181911
/var/chef/backup/home/vagrant/.bashrc.chef-20130614181912
[vagrant@nupic-vagrant:~]$
但是,只有可以找到这些文件的地方是cygwin的安装目录.请看插图,它们反映了目录vagrant和cygwin之间的关系.
But only the place where I can find some of those files is the directory where cygwin is installed. Pls, see illustrations, they reflect relations between directories vagrant and cygwin.
推荐答案
.bashrc
并非要执行,而是要获取.尝试以下方法:
.bashrc
is not meant to be executed but sourced. Try this instead:
. ~/.bashrc
干杯!
这篇关于.bashrc:权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!