Become a MacRumors Supporter for $25/year with no ads, private forums, and more!

Terminal basics and help with the "mv" command

Eetrey

macrumors newbie
Original poster
Apr 20, 2010
5
0
For the life of me I cannot move a file in a terminal. I have seen every example online and when I try my own version I get this response:

usage: mv [-f | -i | -n] [-v] source target
mv [-f | -i | -n] [-v] source ... directory

I have tried "man mv" but the manual was not much help can anyone give me some suggestions. I want to be able to manipulate my files using a terminal. Thanks in advance.
 

Eetrey

macrumors newbie
Original poster
Apr 20, 2010
5
0
sure this is what i gather should work:


mv missed notes 1.pdf /Users/edenpreciado/documents/cee163/missed notes 1.pdf
 
Comment

calderone

macrumors 68040
Aug 28, 2009
3,728
196
Seattle
You have to escape the spaces. And Documents needs to be capitalized, the paths are case sensitive.

So that would actually be:

Code:
mv missed\ notes\ 1.pdf /Users/edenpreciado/Documents/cee163/missed\ notes\ 1.pdf

Also, to make things easier, take advantage of tab completion. For example assuming missed notes was the only file in the current directory that began with mis, typing

Code:
mv mis

And and then typing tab, terminal would autocomplete the path for you. You could then do this throughout the target path as well.

So, /U tab, e tab, Doc tab, etc.
 
Comment

Eetrey

macrumors newbie
Original poster
Apr 20, 2010
5
0
nicely done kind sir. Seriously though, thank you very much. I want to become somewhat familiar with the terminal and this really helps.
 
Comment

samtimmy

macrumors newbie
May 2, 2019
1
0
i have an error when trying to move a file and i want you guys to kindly assist in solving it.
this is what i get
usage: mv [-f | -i | -n] [-v] source target

mv [-f | -i | -n] [-v] source ... directory
this is the command i typed in

sudo mv composer.phar /usr/local/bin folder/composer

 
Comment
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.