带有通配符的rm不起作用。
如果有以ef1 & ef2命名的文件,那么我尝试删除ef1 & ef2。
$ rm ef*这不能擦除ef1 & ef2。
但是就像下面一样,单文件rm正在工作。$ rm ef1 $ rm ef2
尝试用*创建要删除的文件(星号、通配符)
asdf@asdf:~/Documents/rust/hello$ touch ef1 ef2
asdf@asdf:~/Documents/rust/hello$ ls
ef1 ef2 hello main.rs test.c test_c
asdf@asdf:~/Documents/rust/hello$ rm ef*
rm:无法删除“ef*”:没有这样的文件或目录
为什么我不能删除ef1和ef2?
asdf@asdf:~/Documents/rust/hello$ rm -r ef*
rm:无法删除“ef*”:没有这样的文件或目录
asdf@asdf:~/Documents/rust/hello$ rm -f ef*
asdf@asdf:~/Documents/rust/hello$ rm -rf ef*
asdf@asdf:~/Documents/rust/hello$ sudo rm ef*
rm:无法删除“ef*”:没有这样的文件或目录
asdf@asdf:~/Documents/rust/hello$ ls
ef1 ef2 hello main.rs test.c test_c
为什么我不能删除ef1和ef2?
别名rm
bash:别名: rm:找不到
型rm
rm被散列(/usr/bin/rm)
,rm,
/usr/bin/rm
\rm ef*
rm:无法删除“ef*”:没有这样的文件或目录
echo $-
himBHs
发布于 2022-11-19 15:36:07
浪费了两天时间..。
我终于找到了自己的答案。不幸的是,问题在于我自己。
我专注于使用通配符与"sudo -i“一起工作的rm。所以我检查了.bashrc并找到了单行的解决方案。一旦我评论掉了源~~,那么问题就解决了。
在上述来源处有低谷线。我不知道我为什么那样做。
#!/bin/sh #GLOBIGNORE="*“
https://stackoverflow.com/questions/74460710
复制相似问题