LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-08-2003, 01:35 AM   #1
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 65
Question How to open/rename files like this...


Hi again!!!

I've one more question For example, think about a avi file I've in my computer called "Batman01.avi"

If I would like to open it with mplayer (yeah, I got it to work ) I would only type

mplayer Batman01.avi

and there I go. If I need to rename it, no problems either

rename Batman01.avi Batman_01.avi

But how to I do if I have something like this:

Batman TAS - 208 - Mad Love.avi

I cannot rename or execute files with spaces and that length, it always returns me an error. It could be renamed using KDE or Gnome with their konqueror or whatever to browse files, but I cannot do it for 2 reasons:

- I don't use Gnome or KDE (Only IceWM and BlackBox)

- Some of my avi media with names like that are in CD-ROM.

Some programs as xine and avifile can open then like that, but I don't know how to proceed if I need to either rename them or open with a command line...

Any help to this eternal newbie I am would be very helpful

Thanks
 
Old 05-08-2003, 02:55 AM   #2
then
Member
 
Registered: Oct 2002
Location: FDR India
Distribution: RH9, Knoppix, MEPIS
Posts: 65

Rep: Reputation: 15
Hi

May you could try putting the file_name in single-quotes.

regards
theN
 
Old 05-08-2003, 04:06 AM   #3
aizkorri
Member
 
Registered: Feb 2002
Location: Basque Country
Distribution: Fedora 14, Ubuntu 14.04
Posts: 434
Blog Entries: 1

Rep: Reputation: 55
maybe I've understood wrong, but, if you can use the command line it should be easy to rename the files using mv
just "mv film file.avi film_file.avi"
in the case of cd-rom I think the only way is to first copy that files in your hard drive before renaming them.
 
Old 05-08-2003, 05:05 AM   #4
Q*Bert
Member
 
Registered: Feb 2003
Location: Birmingham, UK
Distribution: Redhat 8.0, Immunix 7.0 a few others
Posts: 222

Rep: Reputation: 30
You can either escape the characters by typing the backslash :

A\ Really\ Inconvenient\ Filename\ -\ by\ the\ Artist\ Now\ Known\ As\ Squiggle.avi

or you can put it in double quotes (single quotes won't work):

"A Really Inconvenient Filename - by the Artist Now Known As Squiggle.avi"

PS. Generally, the mv command is used instead of rename. This is one of those minor inconsistencies in Unix that make it fun.
 
Old 05-08-2003, 11:56 AM   #5
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Original Poster
Rep: Reputation: 65
Thanks a lot guys I've learned really much in these forums. mv is a new command for me . But as an old DOS user, I went straight to rename... hehe.
The double quotes will do the job and I've to be more careful with my media's name from now on .

Thanks again for your help and time...
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rename files allelopath Linux - General 5 07-05-2005 03:00 AM
rename all files in a directory merlin23 Linux - Newbie 4 03-24-2005 11:02 AM
quick rename many files cadj Programming 7 12-29-2004 04:14 AM
Can not rename files. Maximus2000 Linux - General 0 04-22-2004 01:36 PM
Need script to rename files joe_stevensen Programming 5 12-05-2003 06:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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