cannot delete files with special characters

Copper Contributor

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