这可能是错误的论坛,但无论如何我都会试一试。我在 Windows 10 Enterprise 中运行 ubuntu 子系统:
root@hostname:/directory/stuff# cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS"
该文件位于 repo 中,并显示为ls
and git status
,但不在 GUI 中(在资源管理器视图选项中检查了“隐藏文件”)或dir
在 cmd 中显示。这是一个“隐藏”文件,当您打开 Excel 电子表格时会显示 - 只有电子表格被关闭。即使我再次打开和关闭,它也无法移除。chmod
我可以用and修改所有权和权限chown
,这很奇怪,我不能做任何其他事情:
root@hostname:/directory/stuff# ll
total 14600
...
-rwxrwxrwx 0 my_name my_name 165 Feb 14 13:25 '~$Copy of Full Compilation of Databases for Audit.xlsx'*
root@hostname:/directory/stuff# chown root: ~\$Copy\ of\ Full\ Compilation\ of\ Databases\ for\ Audit.xlsx
root@hostname:/directory/stuff# ll
total 14600
...
-rwxrwxrwx 0 root root 165 Feb 14 13:25 '~$Copy of Full Compilation of Databases for Audit.xlsx'*
我试过了:
root@hostname:/directory/stuff# ls -i
...
1688849860795414 '~$Copy of Full Compilation of Databases for Audit.xlsx'
....
root@hostname:/directory/stuff# find . -inum 1688849860795414 -exec rm {} \;
rm: cannot remove './~$Copy of Full Compilation of Databases for Audit.xlsx': No such file or directory
....
root@hostname:/directory/stuff# rm -i -- ./*
...
rm: remove regular file './~$Copy of Full Compilation of Databases for Audit.xlsx'? y
rm: cannot remove './~$Copy of Full Compilation of Databases for Audit.xlsx': No such file or directory
....
root@hostname:/directory/stuff# ls -1b
...
~$Copy\ of\ Full\ Compilation\ of\ Databases\ for\ Audit.xlsx
root@hostname:/directory/stuff# rm ~$Copy\ of\ Full\ Compilation\ of\ Databases\ for\ Audit.xlsx
rm: cannot remove '~ of Full Compilation of Databases for Audit.xlsx': No such file or directory
....
root@hostname:/directory/stuff# mv ~\$Copy\ of\ Full\ Compilation\ of\ Databases\ for\ Audit.xlsx just_a_file.xlsx
mv: cannot move '~$Copy of Full Compilation of Databases for Audit.xlsx' to 'just_a_file.xlsx': No such file or directory
任何人都可以添加到这将是伟大的!
更正:
在上面,我说我看不到来自CMD的文件dir
,但我可以dir /a
- 所以 windows 在某种程度上可以看到它。但是,即使从 CMD 中,我仍然无法删除它(奇怪的是它在此处完成制表符)。
C:\Users\me\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState\rootfs\directory\stuff>dir /a
Volume in drive C has no label.
...
2022-02-14 13:25 165 ~$Copy of Full Compilation of Databases for Audit.xlsx
...
C:\Users\me\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState\rootfs\directory\stuff>del "~$Copy of Full Compilation of Databases for Audit.xlsx"
Could Not Find C:\Users\me\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState\rootfs\directory\stuff\~$Copy of Full Compilation of Databases for Audit.xlsx