LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 03-09-2008, 02:38 PM   #1
awl
Member
 
Registered: Aug 2005
Location: Belgrade, Serbia
Distribution: Debian testing
Posts: 30

Rep: Reputation: 15
Question cp problems


Hello,

I needed to copy some files from an winxp ntfs partition to some other place using linux. The problem was that midnight commander i was using to copy the files had a problem with filnames from the ntfs partition which are containing non-ASCII characters (the error was: "...invalid multibyte character..." or similar. I think that on one previous occasion i had the same problem with 'cp' command as well.). Is there some workaround to copy those files?
 
Old 03-09-2008, 03:51 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
From command line when there are odd (non-printing) characters in a filename I've sometimes been able to overcome it by using meta-characters.

Say there were a file that "ls *" displayed as "thisfile" but wouldn't show up when I typed "ls thisfile" I'd know there was a character I couldn't see. So I would try to find a pattern that would match ONLY "thisfile" such as "ls "thisf*" or "ls *hisf*". Once I was sure the ls command had listed only the file I was interested in I would use the same pattern in the copy

So "cp *hisf* newfile" to copy to a new name in same directory or "cp *hisf* newdir" to copy with the same name to a new directory.

Sometimes even that fails due to the special character(s) so putting "./" in front of the pattern helps. "cp ./*hisfile* newfile".
 
Old 03-10-2008, 03:42 AM   #3
awl
Member
 
Registered: Aug 2005
Location: Belgrade, Serbia
Distribution: Debian testing
Posts: 30

Original Poster
Rep: Reputation: 15
Question

To make my question a bit more precise, the NTFS partition in question is yet another WinXP volume which needs to be reformatted and reinstalled due to accumulated malfunction over time to the point of complete disfunction. But the problem is that it has various important *.doc files in various directories which I need to copy somewhere else befor i destroy the system. These documents have sometimes filenames which include Serbian characters (Latin, not Cyrillic) that "cp" has problem with (cannot stat: blah blah invalid or incomplete multibyte character).

Another problem is that am using console-only rescue Linux distribution(PLD linux) to do the copying. This means I can't just run some UTF friendly Gnome/KDE app for the job. Also, even if i could execute the recommended "cp strangecharacterfollows*.doc aconsoletorelablename.doc" command, this is unfeasible because I have numerous different docs all over the directory tree (or yes, maybe I could do it, but doing this manually for each file seems a bit frightening. I would rather like a cp -R Documents\ and\ Settings solution).

Looking at the enviroment variables in PLD linux, I see that supported locales have some of the UTF-8 ones. I thought this should be enough for the console commands to recognise UTF-8 characters, but it seems it is not.

Any furhter advice??? (Instead of downloading a live distribution containing KDE or Gnome. Bandwidth problems there.)
 
  


Reply



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
Slackware 11 on a laptop (problems and problems and problems) kizersouzay Slackware 20 02-08-2007 10:52 AM
Marvell Yukon Network driver problems, Lilo Windows boot Problems mellowdog Slackware - Installation 7 01-25-2006 02:18 AM
Problems, problems, problems. Lets start with the soundcard Kre8ive Linux - Newbie 5 08-07-2003 01:20 AM
Problems, problems, problems. Lets start with the ES 1868 AudioDrive Kre8ive Linux - Newbie 1 08-06-2003 07:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 09:38 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