You are not logged in.

#1 2010-09-30 20:07:37

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

[solved] delete file with ™ (tm, trademark sign) in its name

Hi everyone,

I have some leftover files from Windows that have a ™ (tm, trademark sign) in their names.
The letter doesn't get recognized by my Linux install (it shows as a question mark) which prevents me from removing the files.
I've tried it with rm, rm -f, with quotations, wildcards, with preceding "./", by inode number and by pasting ™ into the filename but nothing works.

I seem to have the right fonts as I can read and use the ™ symbol in Firefox. But in the terminal i just get a question mark instead of the TM.

Any ideas how to solve this problem?

Greets,
demian

Last edited by demian (2010-09-30 20:29:09)


no place like /home
github

Offline

#2 2010-09-30 20:16:45

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,543

Re: [solved] delete file with ™ (tm, trademark sign) in its name

What filesystem?  If its an ntfs formatted disk, you should be able to specify "iocharset=utf8" when you mount the disk.  If vfat, you should be able to include the option "utf8" etc

Offline

#3 2010-09-30 20:17:08

livibetter
Member
From: Taipei
Registered: 2008-05-14
Posts: 95
Website

Re: [solved] delete file with ™ (tm, trademark sign) in its name

I am not sure if this would work:

ls *$'\xe2\x84\xa2'*
rm *$'\xe2\x84\xa2'*

Offline

#4 2010-09-30 20:21:25

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,774

Re: [solved] delete file with ™ (tm, trademark sign) in its name

what if you enter rm the_first_couple_letters_of_the_file_name followed by tab? Autocomplete might get it right


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#5 2010-09-30 20:28:54

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: [solved] delete file with ™ (tm, trademark sign) in its name

It was idd an encoding issue. I remounted the ntfs filesystem with the option iocharset=utf8 and now the tm symbol gets shown correctly and the files can be removed.
It's weird though. It's a samba share and i thought samba has utf8 as default.

But for the record neither auto-completion nor livibetters suggestion (which translated in the terminal correctly into *™*) worked.

Thanks for your quick answers.

Last edited by demian (2010-09-30 20:56:50)


no place like /home
github

Offline

#6 2010-09-30 20:31:12

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved] delete file with ™ (tm, trademark sign) in its name

ewaller wrote:

what if you enter rm the_first_couple_letters_of_the_file_name followed by tab? Autocomplete might get it right

+100
Of course you need a shell that has that sort of autocompletion - dash hasn't.

If by "the terminal" you mean the one outside X, thats normal, because it recognizes only (IIRC) 512 characters. I can display Chinese in Firefox, but will get garbage in the terminal.

Offline

#7 2010-09-30 20:31:27

frabjous
Member
Registered: 2010-07-13
Posts: 367

Re: [solved] delete file with ™ (tm, trademark sign) in its name

You might see if mv is less fussy than rm, and then rename it to something sane, then delete it.

If you're running an (s)ftp server, you might see if its version of rm/del/mdel is smarter than the shell's.

Would it be possible to move everything with a sane name out of the directory, delete the directory, recreate the directory and put everything else back? (Let's hope it isn't in the root folder...)

EDIT: Darn, too slow. Good job, though.

Last edited by frabjous (2010-09-30 20:32:42)

Offline

#8 2010-09-30 20:58:28

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,543

Re: [solved] delete file with ™ (tm, trademark sign) in its name

If you still use windows to access the disk, you probably don't want to keep "iocharset=utf8" as a default because it will allow creation of duplicate filenames that differ only in upper/lower case which will cause windows to barf.

Offline

#9 2010-09-30 21:05:23

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: [solved] delete file with ™ (tm, trademark sign) in its name

Cool, i gotta try that wink.

/edit: Okay so, I created two directories on the ntfs share with utf8 set, one called VALLEY and the other one valley, both in the same directory. I rebooted into Windows, accessed the share over the network and could see both directories in the Windows Explorer. Upon creating a file in one of those directories i noticed that Windows regards those two directories as one directory. If i delete one of the directories, both disappear. Other than that, nothing happens.
Did i misunderstand the bug?

Last edited by demian (2010-09-30 21:23:52)


no place like /home
github

Offline

Board footer

Powered by FluxBB