如何在 Linux 上删除名称中带有 ? 的文件

如何在 Linux 上删除名称中带有 ? 的文件

无法移动或删除名称中带有 ? 的文件​​。有什么想法吗?尝试了以下方法:

# ls
manager?%80%99s-viewpoint.html  what-wcsap-can-offer-you-?%80%93-guide-new-directors.html

# mv manager\?%80%99s-viewpoint.html mangers-viewpoint.html
mv: cannot stat ‘manager?%80%99s-viewpoint.html’: No such file or directory

# rm ./manager\?%80%99s-viewpoint.html 
rm: cannot remove ‘./manager?%80%99s-viewpoint.html’: No such file or directory

# rm -- 'manager?%80%99s-viewpoint.html' 
rm: cannot remove ‘manager?%80%99s-viewpoint.html’: No such file or directory

# rm -- "manager?%80%99s-viewpoint.html" 
rm: cannot remove ‘manager?%80%99s-viewpoint.html’: No such file or directory

# rm -- manager\?%80%99s-viewpoint.html 
rm: remove regular file ‘manager?%80%99s-viewpoint.html’? y
rm: cannot remove ‘manager?%80%99s-viewpoint.html’: No such file or directory

# rm manager*-viewpoint.html 
rm: remove regular file ‘manager?%80%99s-viewpoint.html’? y
rm: cannot remove ‘manager?%80%99s-viewpoint.html’: No such file or directory

# rm -i manager*-viewpoint.html 
rm: remove regular file ‘manager?%80%99s-viewpoint.html’? y
rm: cannot remove ‘manager?%80%99s-viewpoint.html’: No such file or directory

# ls -i
48374896 manager?%80%99s-viewpoint.html
48376904 what-wcsap-can-offer-you-?%80%93-guide-new-directors.html

# find -inum 48374896
./manager?%80%99s-viewpoint.html

# find -inum 48374896 -exec rm -i '{}' \;
rm: remove regular file ‘./manager?%80%99s-viewpoint.html’? y
rm: cannot remove ‘./manager?%80%99s-viewpoint.html’: No such file or directory

# find -inum 48374896 -delete
find: cannot delete ‘./manager?%80%99s-viewpoint.html’: No such file or directory

答案1

好的。我的错。这是一个 VirtualBox 客户端,文件在主机上。当我转到 VB 主机时,我可以正常处理文件。我如何将问题标记为已回答?

相关内容