LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-02-2009, 04:10 PM   #1
Quads
Member
 
Registered: Jul 2008
Location: Indiana
Distribution: Fedora, Ubuntu, Slackware
Posts: 203

Rep: Reputation: 34
Can't delete directory with funny symbols in the name


I have two directories here that have these odd symbols in their names like they are maybe Portugese or something. Anyhow, I can't delete them or move them or anything in dolphin because it keeps giving me an error saying that they do not exist, and I can't type them from a prompt because of the symbols. So what should I do about this?
 
Old 07-02-2009, 04:27 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Varied options:
* try tab-expansion on the command-line.
* try mc
 
Old 07-02-2009, 04:34 PM   #3
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
It's strange that dolphin can't erase them. Are you sure that the file system is 100% sane (fsck) and that your user has read and write permissions over the files you are trying to delete?
 
Old 07-03-2009, 01:29 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,397

Rep: Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777
Try from the cmd line using single quotes around each name, or '\' before those odd chars.
Another technique is to move the sane files to another dir, then 'rm -rf dir'
 
Old 07-03-2009, 06:29 AM   #5
Quads
Member
 
Registered: Jul 2008
Location: Indiana
Distribution: Fedora, Ubuntu, Slackware
Posts: 203

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by chrism01 View Post
Try from the cmd line using single quotes around each name, or '\' before those odd chars.
Another technique is to move the sane files to another dir, then 'rm -rf dir'
Thats what I ended up doing, just moving the good ones out and then as root blowing away the old directory.

I don't know how these files can even be stored to the disk with these crazy symbols in the names if the file system can't even recognize them. I'd like to find some more just to play around with them.
 
Old 07-03-2009, 09:02 AM   #6
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
If the files are there and are correct they should be manageable by the tools, might it mc, rm, dolphin or whatever.

The tools don't implement the low level functions to deal with the fs themselves, that responsibility is shared between glibc and the kernel. That basically means that if the kernel could store the file it should be able to handle it as well. Which is turn means that if the file was correct you shouldn't have any problem to deal with it.

If you couldn't deal with it there must be a problem of other nature. And that's why I suggested you fsck above. Maybe it's nothing, and I don't want to sound like a smart ass, but if there was a problem of fs corruption and you don't solve it you are calling for problem in the future. There's also the possibility that the -hypothetical- fs corruption has been sorted by deleting the files, though.

So I'd just force fsck to run the next reboot to be on the safe side.
 
Old 07-03-2009, 09:22 AM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
One technique you can use is to list the files with the -i option: ls -i, to learn what the inode number is.

Then run "find . -maxdepth 1 -type d -inum <inode#> -exec rmdir '{}' \;"

The maxdepth & type options aren't necessary for the command to work, but may save considerable time locating the file or directory.
Use "-type f" & "-exec rm '{}' \;" to delete a file with "evil" characters.
 
Old 07-04-2009, 03:45 PM   #8
Quads
Member
 
Registered: Jul 2008
Location: Indiana
Distribution: Fedora, Ubuntu, Slackware
Posts: 203

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by i92guboj View Post
So I'd just force fsck to run the next reboot to be on the safe side.
I ran fsck and everything appears fine.

What is strange though(and I posted it in another thread), is that two times now the machine has rebooted randomly, and this machine has been running stable for months. Nothing in the logs at all about why it would reboot.

Is it possible that the two things are related? It seems to be a little too coincedential to me. Hard drive failing maybe?
 
Old 11-28-2009, 08:56 PM   #9
KindOfNeutral
LQ Newbie
 
Registered: Jan 2009
Location: Finland
Distribution: Ubuntu
Posts: 11

Rep: Reputation: 0
Sorry for bringing up an old thread...

I have seen the same behavior with Dolphin (and actually also Krusader and Konqueror): it can't handle files with incorrect (or invalid? - I don't have these programs in English) character encoding in their filenames. Incorrectly encoded characters are shown with a diamond shape containing a question mark. It can't delete them, move them, copy them or open them with an application. Thunar an PCMan File Manager shows the files in the same way but have no problems in handling them. Also Nautilus can work with them but won't open the trash bin if it contains a file with incorrect character encoding.

I have some Japanese .mp3 files with these problematic characters. I think that in some Asian countries they have used some other codes for their characters (not Unicode) and western computers don't know how to handle them.

So to answer the last post: If Dolphin can't handle files with funny characters, it do not mean that the hard drive is failing. It is just that the file manager can't handle filenames with incorrectly encoded characters.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Debugger selectively not using symbols in library with symbols Millenniumman Programming 5 03-25-2007 09:44 AM
Cannot see some symbols in file/directory-name in RH 9.0 No-0n3 Linux - Newbie 0 07-20-2005 06:28 PM
shell script: delete all directories named directory.# except directory.N brian0918 Programming 3 07-13-2005 06:54 PM
Directory permissions acting funny... ifm Linux - Newbie 1 06-11-2002 02:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration