ファイルでlsまたはコマンドを使用すると問題が発生します: '\'、 '\\'エスケープを使用しても同じです。

ファイルでlsまたはコマンドを使用すると問題が発生します: '\'、 '\\'エスケープを使用しても同じです。

Windows WSL Bashサブシステムでは、ファイルが含まれているように見えるディレクトリがあります'\'

ディレクトリを削除しようとしましたが失敗しました。lsディレクトリで使用すると、出力が表示されます。

$ ls
ls: cannot access '\': No such file or directory
'\'
$ ls -li
ls: cannot access '\': No such file or directory
total 0
? -????????? ? ? ? ?            ? '\'

エスケープ文字の問題だとし、次のことを試しました。

$ rm '\\'
rm: cannot remove '\': No such file or directory
$ rm "\\"
rm: cannot remove '\': No such file or directory
$ rm "./\\"
rm: cannot remove './\': No such file or directory
$ rm './\\'
rm: cannot remove './\\': No such file or directory
$ rm './\'
rm: cannot remove './\': No such file or directory

...そして関連ディレクトリの外で何度も繰り返されます。

この「ファイル」とそれを含むディレクトリ(おそらく)をどのように削除できますか?

編集する:

このディレクトリは外部USBディスクにあります。

ディレクトリ名を変更できます。

$ ls -ld: "."のエントリを返します。

ベストアンサー1

これは一般的なファイルシステムの問題であることがわかりました。 Windows powershellを使用してchkdsk \f問題のあるアイテムを削除して問題を解決しました。

おすすめ記事