cannot delete files with special characters

%3CLINGO-SUB%20id%3D%22lingo-sub-1567089%22%20slang%3D%22zh-CN%22%3Ecannot%20delete%20files%20with%20special%20characters.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1567089%22%20slang%3D%22zh-CN%22%3E%3CP%3ETha%20i%20delete%20sby%20rd%20or%20del%20command%2C%20the%20cmd%20is%20a%20yes%20file%2C%20directory%20name%20or%20volume%20label%20label%20is%20rhesan.%26nbsp%3B%3C%2FP%3E%3CP%3EThen%20I%20turn%20to%20wsl2%2C%20and%20rm%20find%20no%20such%20file%20or%20directory.%3C%2FP%3E%3CP%3EBelow%20are%20the%20results%20from%20ll%20(ls%20-l)%3C%2FP%3E%3CP%3Es%3A%20cannot%20access%20'1'''%3ANosuch%20file%20or%20directory.%3C%2FP%3E%3CP%3Es%3A%20cannot%20access%20'2''%3A%3A%20Nosuch%20file%20or%20directory.%3C%2FP%3E%3CP%3Es%3A%20cannot%20access%20'3''%3A%3A%20Nosuch%20file%20or%20directory.%3C%2FP%3E%3CP%3Es%3A%20cannot%20access%20'4'''''''.'log'%3A%20Nosuch%20file%20or%20directory.%3C%2FP%3E%3CP%3ETotal%200.%3C%2FP%3E%3CP%3Edrwxrwwx%201%20teemo%20teemo%204096%20Aug%205%2014%3A29%20.%2F%3C%2FP%3E%3CP%3Edrwxrwwx%201%20teemo%20teemo%204096%20May%2021%2018%3A44%20%3A.%20%2F%3C%2FP%3E%3CP%3E-%3F%3F%3F%3F%3F%3F%3F%3F%3F%20%3F%20%3F%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3F%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3F%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3F%20'1''''''''''''''''''''''''%3C%2FP%3E%3CP%3E-%3F%3F%3F%3F%3F%3F%3F%3F%3F%20%3F%20%3F%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3F%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3F%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3F%20'2''''''''''''''''''''''''%3C%2FP%3E%3CP%3E-%3F%3F%3F%3F%3F%3F%3F%3F%3F%20%3F%20%3F%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3F%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3F%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3F%20'3''''''''''''''''''''''''%3C%2FP%3E%3CP%20class%3D%22%22%3E-%3F%3F%3F%3F%3F%3F%3F%3F%3F%20%3F%20%3F%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3F%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3F%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3F%20'4''''''''''''.log'%3C%2FP%3E%3CP%20class%3D%22%22%3EThe%20auto%20complete%20from%20the%20press%20TAB%20inside%20wsl2%20shell%20shows%20like%20names%20file%20as%20below%3A%3C%2FP%3E%3CP%20class%3D%22x-hidden-focus%22%3E1'M.%3C%2FP%3E%3CP%3E2'M.%3C%2FP%3E%3CP%20class%3D%22x-hidden-focus%22%3E3'M.%3C%2FP%3E%3CP%20class%3D%22x-hidden-focus%22%3E4'M.log.%3C%2FP%3E%3CP%20class%3D%22x-hidden-focus%22%3ETell%20me%20how%20to%20delete%20them%2C%20please!%26nbsp%3B%20Thank%20you%20for%20your%20time.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

When I delete files by rd or del command, the cmd says file name, directory name or volume label syntax is incorrect. 

Then I turn to wsl2, and rm find no such file or directory.

Below are the results from ll (ls -l)

ls: cannot access '1'$'\r': No such file or directory

ls: cannot access '2'$'\r': No such file or directory

ls: cannot access '3'$'\r': No such file or directory

ls: cannot access '4'$'\r''.log': No such file or directory

total 0

drwxrwxrwx 1 teemo teemo 4096 Aug  5 14:29  ./

drwxrwxrwx 1 teemo teemo 4096 May 21 18:44  ../

-????????? ? ?     ?        ?            ? '1'$'\r'

-????????? ? ?     ?        ?            ? '2'$'\r'

-????????? ? ?     ?        ?            ? '3'$'\r'

-????????? ? ?     ?        ?            ? '4'$'\r''.log'

The auto complete from pressing TAB inside wsl2 shell shows different file names as below:

1^M

2^M

3^M

4^M.log

Tell me how to delete them, please!  Thank you for your time.

0 Replies