Ibn*_*shd 0 unix vim bash windows-subsystem-for-linux
我有一个名为的文件 && !!
如何删除此文件.
On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
&& !!
Run Code Online (Sandbox Code Playgroud)
rm -- "&& !!"
结果: rm: cannot remove '&& git st': No such file or directory
你可能已经猜到了git st是我的方式 git status
我怎么去?
打开vim
:e && !!
:wq
您的rm -- "&& !!"尝试失败,因为历史记录扩展被!!先前执行的命令取代.您可以通过在单引号中引用文件名来避免这种情况,因为您不需要展开内容:
rm -- '&& !!'
Run Code Online (Sandbox Code Playgroud)
历史扩展比我更喜欢绊倒我,我从未找到过该功能的用途,所以我选择通过添加set +H到我的功能来禁用它.bashrc.