LinuxAnswers - the LQ Linux tutorial section.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 05-31-2005, 09:31 AM   #1
LQ Newbie
Registered: May 2005
Posts: 1

Rep: Reputation: 0
rename file names with " ? characters

I have started encoding my CD collection and some of the files are being named with " and ? characters in the name. This is not a problem with Linux but becomes a problem when I share the files with SAMBA and try to access them with Windows.

I can rename these by hand one at a time but there are so many of them that I need to try and find an automated way to remove the characters with a script or with some setting on Linux to prevent files from being named with these characters.

I am using Mepis which is a Debian distro. I am ripping the files with KAudioCreator which uses Lame to encode the file. KAudioCreator access for the track names which is where the " and ? characters are coming from.

Any help with renaming these files is appreciated.
Old 05-31-2005, 10:09 AM   #2
Registered: Dec 2003
Location: Northern VA
Posts: 493

Rep: Reputation: 30
usually in programs like that, you can - under some option, tell it to make those type of characters and _ or some such. That's the first thing I would check.

After that, the ones that you already have, you may be able to find a rename program that will do it for you, otherwise it's a roll your own solution.
Old 05-31-2005, 11:20 AM   #3
Senior Member
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 53
A script like this should do it:
for i in *.mp3
mv $i `echo $i|sed -e 's/?//g'`

Just change it according to needs, make it executable and run it in the directory with the files. Alternatively you can put it under /usr/local/bin/ and give it some unique name.


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
renaming file names beginning with "-" prashln Linux - General 5 05-01-2010 01:47 AM
Can i limit new file names created to 8 characters with samba ? amitsharma_26 Linux - Networking 1 12-16-2005 05:42 AM
rename file with "mv" not working for folder? Niceman2005 Linux - Newbie 2 03-13-2005 09:34 PM
"Edit and rename swaret conf" or whatever. PROBLEM! Kjetil4455 Slackware 8 04-14-2004 03:00 PM
need help, on how to access quickly to special characters like "" or ""? Motaro Linux - Newbie 1 12-31-2003 11:53 AM

All times are GMT -5. The time now is 09:15 PM.

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