PDA

View Full Version : trouble changing a folder name in terminal




SHankara
Nov 27, 2007, 12:48 PM
im trying to rename a folder with the "mv" command but its not working

heres what I do

mv カトロ .カトロ

but it just goes to the resulting mv command options,is it becuase of the japanese characters,or becuase the folder is on a diff volume?



SHankara
Nov 27, 2007, 12:56 PM
or should i try a diff shell?

Cromulent
Nov 27, 2007, 12:58 PM
Type mv *original name* *new name*.

Basically you just move the original to a new name if that makes sense. Unix type system work slightly differently.

Edit : bah didn't read the thread... :(

As far as I am aware you shouldn't have any problems with that as long as you are moving the folder within the same directory.

Big Dave
Nov 27, 2007, 01:29 PM
In Unix, . is a special character usually equating to the current directory. IE moving something from /some/path to . (current location). Try escaping before the . meaning mv file \.file or mv file "file"

itickings
Nov 27, 2007, 02:05 PM
im trying to rename a folder with the "mv" command but its not working

heres what I do

mv カトロ .カトロ

but it just goes to the resulting mv command options,is it becuase of the japanese characters,or becuase the folder is on a diff volume?

Try quoting the names instead. Obviously I have no idea what you are trying to rename to what, but if it is カトロ to .カトロ, try this:

mv "カトロ" ".カトロ"

Edit: If you copied your exact command line when you posted, the problem is that the " " is a blank character which is not a space " ". mv then sees only one parameter because of this, not two.

Peace
Nov 27, 2007, 02:08 PM
Pardon my ignorance but wouldn't it be easier to just click on the folder and change the name ?

This is under the assumption you're doing this from the same computer of course.:)

ChrisA
Nov 27, 2007, 06:44 PM
Pardon my ignorance but wouldn't it be easier to just click on the folder and change the name ?


No. It is quicker to type"mv a b" than to click the finder icon, wait for it to start then drill down to the folder and click the name and change it. Got a stopwatch? Try it both ways.

SHankara
Nov 27, 2007, 07:49 PM
Try quoting the names instead. Obviously I have no idea what you are trying to rename to what, but if it is カトロ to .カトロ, try this:

mv "カトロ" ".カトロ"

Edit: If you copied your exact command line when you posted, the problem is that the " " is a blank character which is not a space " ". mv then sees only one parameter because of this, not two.

Thanks it worked,but can you explain why this worked for the japanese characters?regular roman text doesnt need the quotes

SHankara
Nov 27, 2007, 07:52 PM
WOW strange I dont know if its bug,but I jsut renamed without the qoutes.something to do with spacing of roman and japanese characters!

thanks for your guys help!

itickings
Nov 28, 2007, 02:24 PM
WOW strange I dont know if its bug,but I jsut renamed without the qoutes.something to do with spacing of roman and japanese characters!

thanks for your guys help!

It was all the spacing as I pointed out in my edit.

Quotes are often good to use though, they can help avoid disasters. The Terminal is very powerful, it can help you do your work fast, or help you screw up your system even faster :p