LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 03-16-2004, 04:19 AM   #1
pleasehelp
LQ Newbie
 
Registered: Feb 2004
Distribution: Fedora Core 1
Posts: 27

Rep: Reputation: 15
Red face Can't rename file with parenthesis in name


hey everyone

im using RH9 and just got overnet working and im downloading some stuff. i have a file called (Banned Commercials) Coca Cola Christina Aguilera vs PEPSI Britney Spears.mpeg

and i know my mplayer and xine works fine but it wont let me see the file cause of the (banned commercials) part

it sez.... bash: syntax error near unexpected token `Banned\ Commercials'

then i try to rename it but it sez--------> bash: syntax error near unexpected token `('

I CAN RENAME ANY FILE IN THAT DIRECTORY BUT NOT IF IT HAS A PAREN IN THE NAME.


whats the deal with this i dont get it? any tips?
 
Old 03-16-2004, 04:57 AM   #2
verstapp
Member
 
Registered: Feb 2004
Location: canberra australia
Distribution: Suse 9.0
Posts: 44

Rep: Reputation: 15
Try putting the whole thing in "s. Doing

mv "(test)" test

worked for me.
 
Old 03-16-2004, 06:19 AM   #3
pleasehelp
LQ Newbie
 
Registered: Feb 2004
Distribution: Fedora Core 1
Posts: 27

Original Poster
Rep: Reputation: 15
damn i tried it but it says---> mv: can't stat source (Banned\ Commercials)

and with single quotes same thing mv '(file)' newfile

could it be cause this file name is too long or something?

anyone know?

Last edited by pleasehelp; 03-16-2004 at 08:12 AM.
 
Old 03-16-2004, 07:34 AM   #4
Pres
Member
 
Registered: Jun 2002
Location: Australia
Distribution: Slack 9.1
Posts: 232

Rep: Reputation: 30
Try using the inverted commas only around the parentheses, example,

mv "("banned adds")" christina agu ... etc ... in fact you want to enclose those spaces in quotes too. Such that -

mv "("banned" "add") "christina" "aguilera" " ... etc .. newname.mpg

or get the old wildcards out

mv *spears.mpg newname.mpg

Try going through midnight commander, it's a smart app. Type "mc" at the command line, traverse your tree until you get the file in the crosshair and press F6 to do a rename.

Or perhaps try a rename using konquerer or another file manager. Or, if things get very desperate, you can try substituting the ascii codes instead of the parentheses using the \xHH hexvalues method.

One of these could work !

Last edited by Pres; 03-16-2004 at 07:47 AM.
 
Old 03-16-2004, 03:01 PM   #5
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
mv \(Banned\ Commercials\) not_dumb_title

mv '(Banned Commercials)' not_dumb_title

Just don't mix and match your escapes.
 
  


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
How can i Rename file? Khmer Linux - Newbie 4 10-21-2005 08:09 AM
vim matching parenthesis rohr Linux - Software 2 04-23-2005 05:12 PM
Multiple file rename jrdioko Linux - Newbie 10 11-07-2004 05:25 PM
How do I rename a file? Thaidog Linux - Newbie 5 10-10-2003 10:28 PM
How to rename a file? juanb Linux - General 4 03-19-2003 11:20 AM

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

All times are GMT -5. The time now is 04:35 PM.

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