Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am in the process of moving a large collection of MP3s from an OS/2 partition. First, I copied them all to CDRs and now I will copy them to my Fedora drive.
One hiccup: many of the filenames have accented characters (ie, é, ó, á) and they look like this under Linux:
I have several hundred files like this and I'd rather not to have to fix them all manually. Is there a way of doing this on the command line with regular expressions or such like?
This problem is probably caused by having the wrong character set on the original OS/2 filesystem; try using the charmap=character-set option in /etc/fstab.
Without knowing which character set you were using, it's difficult to work out what the characters were or should be, so fixing the mount options of your original filesystem is the best place to start.
Originally posted by rjlee This problem is probably caused by having the wrong character set on the original OS/2 filesystem; try using the charmap=character-set option in /etc/fstab.
Without knowing which character set you were using, it's difficult to work out what the characters were or should be, so fixing the mount options of your original filesystem is the best place to start.
Hi, I was using codepages 437,850 under OS/2. I don't think they were "wrong" in the sense that they were correct under OS/2. However, for some reason they don't translate properly to Linux.
I can't find any documentation on using a charmap option either in /etc/fstab or when mounting a CDROM on the command line with mount. Are you sure this is possible?
You may have typoed the $ before the ()'s. Other possibilities would be using the * wildcard, or the ? single character substitution. The asterisk matches any and all characters, the ? matches any one character. This would work from the directory with all your mp3s.
Code:
cp ./*.mp3 /destination
Or just do a recursive copy if you have multiple directories. This will copy all files inside the parent directory.
Code:
cp -R /mnt/cdrom /destination
Or you could always attempt tab completion if typing out a single name.
edit: woops, sorry, misunderstood the first post, disregard
You need for foo in $(find . -name *.mp3);do mv $foo $(echo $foo|tr A a);done
and
mv coraz?n.txt $(echo coraz?n.mp3|tr A a)
I am using bash. I'm sure the syntax is different for other shells. Also, It might be treating the '?' as a regular expression. Mabye you need to escape the '?' (ie substitute coraz?n.txt with coraz\?n.txt, etc.)
Well, I can get this to work on a string without accented characters, but I can't get tr to filter the accented characters properly. For example, the ó in the word corazón is represented by an empty box on the command line (and a question mark if I just paste it in here). However, when you copy the file on the command line, the OS represents it with a \242.
After tinkering with the shell stuff and not getting anywhere, I cobbled together a script in Rexx which does everything I need. The tricky bit was figuring out what exactly the illegal characters are, since Linux represents them all as an empty box on the command line. Well, they turn out to be just plain old ASCII codes. So, using the C2D() function in Rexx, I parse the filenames character by character looking for a buch of values like 130 ("é") and converting them to what Linux displays as the correct character. Probably some similar could be done in Python or Perl or perhaps even a shell script, but I am most familiar with Rexx.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.