Terminal basics and help with the "mv" command

Discussion in 'Mac Basics and Help' started by Eetrey, May 8, 2010.

  1. Eetrey macrumors newbie

    Joined:
    Apr 20, 2010
    #1
    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.
     
  2. calderone macrumors 68040

    calderone

    Joined:
    Aug 28, 2009
    Location:
    Seattle
  3. Eetrey thread starter macrumors newbie

    Joined:
    Apr 20, 2010
    #3
    sure this is what i gather should work:


    mv missed notes 1.pdf /Users/edenpreciado/documents/cee163/missed notes 1.pdf
     
  4. calderone macrumors 68040

    calderone

    Joined:
    Aug 28, 2009
    Location:
    Seattle
    #4
    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.
     
  5. Eetrey thread starter macrumors newbie

    Joined:
    Apr 20, 2010
    #5
    nicely done kind sir. Seriously though, thank you very much. I want to become somewhat familiar with the terminal and this really helps.
     
  6. calderone macrumors 68040

    calderone

    Joined:
    Aug 28, 2009
    Location:
    Seattle
  7. samtimmy macrumors newbie

    Joined:
    May 2, 2019
    #7
    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

     
  8. Mr_Brightside_@ macrumors 68030

    Mr_Brightside_@

    Joined:
    Sep 23, 2005
    Location:
    Toronto
    #8
    folder/composer is the problem, that's not actually a file path. What's the path to the folder you want it in?
     

Share This Page

7 May 8, 2010