2

I transferred two files from a Windows device to an Android device via xftp.

The names of these two files appear as garbled characters on my Android device, for example, �������ѹ�͵���Ĺ�ϵ.ts

Files can be opened but cannot be deleted or otherwise operated on. For example, one of them is .docx file, I can be opened with Microsoft 365(Office)

But when I try to delete it, I get a message that No such file or directory

The file was transferred via xftp (I don't seem to have changed the default encoding Settings), and the original name of the file was Chinese.

More information about the file

~/storage/downloads $ ls -il
total 189320
320255 -rw-rw---- 1 root everybody         0 Aug  4 13:05 ''$'\241\266''ˮ䰴'$'\253\241\267''.docx'
449669 -rw-rw---- 1 root everybody 193668200 Aug 17 19:07 ''$'\265\347\301\367\323\353\265\347''ѹ'$'\272''͵'$'\347\327\350\265''Ĺ'$'\330''ϵ.ts'
~/storage/downloads $

Device version

  • Samsung SM-A5260 (Galaxy A52 5G)
  • Hardware version: REV0.4
  • One UI version: 5.1
  • Android version: 13

Try

  1. I tried to delete the file using the file manager, but I could not find the two files in the system default file manager. I could find the two files in other file managers but there was an error when performing the deletion.
  • I tried to empty the folder (keep only these two files in it), show two items in the folder in the system default file manager, but it appears empty after opening the folder (even if Show hidden files is checked)
  1. I try to use termux perform operations, and when I enter rm �������ѹ�͵���Ĺ�ϵ.ts, it returns rm: cannot remove '�������ѹ�͵���Ĺ�ϵ.ts': No such file or directory

  2. I also try to use the adb shell executive rm �������ѹ�͵���Ĺ�ϵ.ts still get the same results

  3. When I try to delete the entire directory rm ./Download -r, the terminal returns

rm: ��ˮ䰴���.docx: No such file or directory
rm: �������ѹ�͵���Ĺ�ϵ.ts: No such file or directory
  1. Commands such as' rm *.docx 'are invalid

  2. Eventually I tried it

$ ls -i
320255 \241\266ˮ䰴\253\241\267.docx  449669 \265\347\301\367\323\353\265\347ѹ\272͵\347\327\350\265Ĺ\330ϵ.ts
$ find -inum 320255 -delete
$ ls
\241\266ˮ䰴\253\241\267.docx  \265\347\301\367\323\353\265\347ѹ\272͵\347\327\350\265Ĺ\330ϵ.ts

Although there is no error message when executed, the file still exists after ls again.

  • I also try find./ -inum 320255 -print -exec rm {} \\; or other similar instructions. I get the same result (no errors but the file still exists)
  1. I also tried to change the encoding of the terminal but without success.
1
  • Did you manage to resolve this issue?
    – QkiZ
    Jan 27 at 16:37

3 Answers 3

0

I have the same problem with a . webm file. I proved this:

rm -i *.webm

And worked!

So try this

rm -i *.ts
rm -i *.docx

I think this happened because there are characters not fully recognized by the terminal.

Hope it helps!

-1

I think you're hitting problems because you have single-quote characters as part of the filenames. First, make sure you have only the two problematic files in the directory, cd there in the ADB shell, do an ls -A to make sure there isn't anything else in the directory, and then do

rm -i *

That will prompt you to confirm each deletion, and may well do the job.

2
  • The problem is that the * is expanded by the shell not by the rm command, thus most likely it will cause the same problems.
    – Robert
    Nov 20, 2023 at 20:35
  • I tried to execute it, but it still gave me an error: a52xq:/storage/self/primary/Download $ rm -i * rm ��ˮ䰴���.docx (y/N):y rm: ��ˮ䰴���.docx: No such file or directory rm �������ѹ�͵���Ĺ�ϵ.ts (y/N):y rm: �������ѹ�͵���Ĺ�ϵ.ts: No such file or directory Nov 24, 2023 at 13:54
-1

Here's a different answer. Again, make sure you have only the two problematic files in the directory, cd there in the ADB shell, and do an ls -A to make sure there isn't anything else in the directory. Then try this:

ls -b

That should get you the files' names with fully-escaped characters. If that seems to work, try this:

rm -i $(ls -b)  
1
  • 1
    Unfortunately, it still gives an error: a52xq:/storage/self/primary/Download $ ls -a \241\266ˮ䰴\253\241\267.docx \265\347\301\367\323\353\265\347ѹ\272͵\347\327\350\265Ĺ\330ϵ.ts a52xq:/storage/self/primary/Download $ ls -b \241\266ˮ䰴\253\241\267.docx \265\347\301\367\323\353\265\347ѹ\272͵\347\327\350\265Ĺ\330ϵ.ts a52xq:/storage/self/primary/Download $ rm -i $(ls -b) rm: \241\266ˮ䰴\253\241\267.docx: No such file or directory rm: \265\347\301\367\323\353\265\347ѹ\272͵\347\327\350\265Ĺ\330ϵ.ts: No such file or directory Dec 2, 2023 at 5:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .