Spaces and paranthesis in a file name

New to Debian (Or Linux in general)? Ask your questions here!

Spaces and paranthesis in a file name

Postby Repesorsa » 2018-08-28 13:06

For example, I do have a file with a name like this: al5. (r) 2010 same as al5.[space][space](r)[space]2010

Now, I'm tryin to change the name of file with mv command to acelemon:

mv -T al5.\ \(r\)\ 2010 acelemon

linux is tryin to see the new filename as an operand.

What kind of character should I use to make the change of filename working?
Repesorsa
 
Posts: 22
Joined: 2018-03-24 10:21

Re: Spaces and paranthesis in a file name

Postby L_V » 2018-08-28 13:16

Code: Select all
mv 'al5. (r) 2010' acelemon
L_V
 
Posts: 799
Joined: 2007-03-19 09:04

Re: Spaces and paranthesis in a file name

Postby Repesorsa » 2018-08-28 13:54

Don't work.

Bash says:

...can not be read: There is no file or directory
Repesorsa
 
Posts: 22
Joined: 2018-03-24 10:21

Re: Spaces and paranthesis in a file name

Postby Repesorsa » 2018-08-28 13:59

Ok, now I found out that after the name there were two spaces more. Problem solved!
Repesorsa
 
Posts: 22
Joined: 2018-03-24 10:21

Re: Spaces and paranthesis in a file name

Postby debiman » 2018-08-28 17:57

another idea (what i do more and more often):
Code: Select all
mv al<Tab><Tab> (completes to properly escaped filename) acelemon
User avatar
debiman
 
Posts: 3027
Joined: 2013-03-12 07:18

Re: Spaces and paranthesis in a file name

Postby arzgi » 2018-08-30 10:05

debiman wrote:another idea (what i do more and more often):
Code: Select all
mv al<Tab><Tab> (completes to properly escaped filename) acelemon


And for us lazy ones, there is mc, which among other things, can open and rename files, which include spaces or specaial characters.
arzgi
 
Posts: 389
Joined: 2008-02-21 17:03
Location: Finland


Return to Beginners Questions

Who is online

Users browsing this forum: Starborn and 5 guests

fashionable