Why isn't this command working

Discussion in 'Mac Apps and Mac App Store' started by iroh, Dec 23, 2013.

  1. iroh macrumors newbie

    Joined:
    Dec 22, 2013
    #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
     
  2. LPZ macrumors 65816

    Joined:
    Jul 11, 2006
    #2
    Remove the single quotes. And you probably want /Volumes/One/NES.
     
  3. MacUser2525 macrumors 68000

    MacUser2525

    Joined:
    Mar 17, 2007
    Location:
    Canada
    #3
    And you probably want /Volumes/One/NES/.
     
  4. LPZ macrumors 65816

    Joined:
    Jul 11, 2006
    #4
    The slash after NES isn't needed.
     
  5. MacUser2525 macrumors 68000

    MacUser2525

    Joined:
    Mar 17, 2007
    Location:
    Canada
    #5
    You have just set the OP up for failure next time when it is needed.
     
  6. LPZ macrumors 65816

    Joined:
    Jul 11, 2006
    #6
    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
     
  7. dyn macrumors 68030

    Joined:
    Aug 8, 2009
    Location:
    .nl
    #7
    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:
     

Share This Page