Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

i was hoping to utilize this trick
How to move the Downloads folder (in Mountain Lion) to another disc
to move my Downloads folder inside a directory called "disktop zi5" which is inside the directory "synktorium" in my home folder
but when i try
sudo mv ~/Downloads ~/synktorium/disktop zi5/Downloads
i get:
usage: mv [-f | -i | -n] [-v] source target
mv [-f | -i | -n] [-v] source ... directory
what am i doing wrong??

share|improve this question
    
Why not just change the preference in Safari as to where to save downloaded files? –  Mark Mar 12 '13 at 11:15

1 Answer 1

up vote 4 down vote accepted

The shell in Terminal doesn't like white space in file names. That's what resulted in the error message. You need to use quotes to tell the shell that the second path is a single parameter, try

sudo mv ~/Downloads ~/synktorium/"disktop zi5"/

Alternatively, you could escape the single space before zi5

sudo mv ~/Downloads ~/synktorium/disktop\ zi5/

This is what OS X and Finder would do if you dragged the folder into terminal but it's less clear to someone than using " to prevent mv from seeing three arguments instead of two (a source and destination).

share|improve this answer
    
thanks! this is the result<br> `mv: rename /Users/jk/Downloads to ~/synktorium/disktop zi5/: No such file or directory' –  johannes Mar 12 '13 at 10:51
    
My bad, sorry. Just use @bmike's version or my update to the initial command –  patrix Mar 12 '13 at 10:53
    
it works. many thanks! –  johannes Mar 12 '13 at 10:56
    
Escaping spaces (and other characters) is such a pain. Especially when you start using shell variables and non simple ascii character sets... –  bmike Mar 12 '13 at 11:05
    
I would have bet a lot that ~ gets expanded inside double quotes. oh well. –  patrix Mar 12 '13 at 11:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.