Why isn't this command working

iroh

macrumors newbie
Original poster
Dec 22, 2013
1
0
mv '*.nes' 'Volumes/One/NES'

I am trying to move all files ending with .nes to my external game library, but when I use that command, I get the following.

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

I don't understand what it is asking, and I don't know why this (seemingly easy) command isn't working (when it works flawlessly on my server via ssh).

- Thanks for the help
 

LPZ

macrumors 65816
Jul 11, 2006
1,221
1
mv '*.nes' 'Volumes/One/NES'

I am trying to move all files ending with .nes to my external game library, but when I use that command, I get the following.

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

I don't understand what it is asking, and I don't know why this (seemingly easy) command isn't working (when it works flawlessly on my server via ssh).

- Thanks for the help
Remove the single quotes. And you probably want /Volumes/One/NES.
 

LPZ

macrumors 65816
Jul 11, 2006
1,221
1
You have just set the OP up for failure next time when it is needed.
Dear iroh,

Please be sure to include a slash after NES. It isn't needed; the mv command inserts it automatically. But using it is good practice, as MacUser2525 points out.

LPZ
 

dyn

macrumors 68030
Aug 8, 2009
2,708
384
.nl
You have just set the OP up for failure next time when it is needed.
No, UNIX did itself. There are command where you need to put a / behind it, there are also commands where you really shouldn't put a / behind it because it will do something else than you are expecting it to do. Always read the manual of the command to see if the / is necessary or not and do read what it'll do exactly if you put a / behind it. In case of mv you are correct though: without a / behind it the mv command can see it as a name instead of a directory. It will then rename files instead of moving them into the given directory. Luckily this is also the general behaviour but do be careful with it.

This also applies to many other parameters that can be set like when to be recursive (is it -r or is it -R?).

Bloody annoying :mad:
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.