.bashrc 已存在于目录中时无法编辑

can't edit .bashrc while it is already present in the directory

我正在我的 Windows 子系统中为我的 windows 10 机器中的 Linux 设置 zsh,方法是按照一些指导打开我的 bash 配置文件的教程以下命令

vim~/.bashrc

但是它说

bash: vim~/.bashrc: No such file or directory

我试过使用

ls -la ~/ | more

这表明文件存在,甚至尝试从 /etc/skel 复制它,但仍然没有成功

试试下面的命令

vi ~/.bashrc

是的,我 运行 命令不正确,它需要一个 space,正如@john1024 所建议的,但是 运行 命令中的任何一个

vim ~/.bashrc

vi ~/.bashrc

警告我该文件已经打开,类似 bashrc.swap 文件...最终进行了编辑并保存。感谢您的快速支持。 (y)