Total Newbie question about file copying in terminal

Discussion in 'macOS' started by Robsa, Mar 18, 2010.

  1. Robsa macrumors newbie

    Feb 1, 2009
    Hi guys

    I am a recent mac convert (and loving it... finally! I think its the move to Unix-framework that has changed my opinion of the mac OS) and have just bought a MyBookWorld network drive to dump all my media on which is currently on my macbook unibody.

    Ok, so I know its a pretty crappy product... copying is agonizingly sloooow and is always falling over.

    I have been trying to enter terminal and use the cp command to copy, hoping I can set it off before sodding off on a long weekend and returning to find the job done. However, I have not managed it yet.

    I cannot get the syntax right when trying to copy to the shared MyBookWorld drive. I have no idea about how to locate directories. In windows I could say, for example, C:/users/robsa/my docs/media/tv/the simpsons or whatever, but I have no idea how to do it in OSX. Also, ditto accessing the MyBookWorld directories which I see in 'SHARED' in finder. Again, in windows it would be something like //MyBookWorld/Media/TV/... and so on. I have tried all sorts of different things but nothing works.

    so I want to say something like:

    cp -r C:/users/robsa/my docs/media/tv/*.* //MyBookWorld/Media/tv

    if you see what I mean. Except it would be, on a mac:

    cp -r Users/Robsa/Downloads/ SHARED/MyBookWorld/Media/

    But this does not work, nor do any variations I have tried.

    PLEASE can someone help a dumb newb out?! :eek:)

    I just want a robust way of copying all these files over which isnt going to fall over....

    Many thanks in advance!

  2. plinden macrumors 68040


    Apr 8, 2004
    To copy your home's Downloads directory, just use ~:
    cp -r ~/Downloads ...destination...
    As for the destination, mounted drives are under /Volumes. What does this show?:
    ls /Volumes
    If your external drive is called MyBookWorld, you'd type:
    cp -r ~/Downloads /Volumes/MyBookWorld/.
    This will copy the Downloads directory to the root of MyBookWorld, so you'd see a Downloads directory there.

    If you just want to copy the contents of Downloads (including sub directories) use:
    cp -r ~/Downloads/* /Volumes/MyBookWorld/some\ destination\ directory/.
  3. splitpea macrumors 6502a

    Oct 21, 2009
    Among the starlings
    Use a leading forward slash to reference the root directory of your system:

    [NOTE: brackets indicate a placeholder. Remove the brackets and replace the contents with the actual directory, volume, user, etc name]

    System root:
    External drive root:
    Users directory:
    Applications directory:
    Your home directory (two ways to reach):
    Your Desktop:
    Whatever directory you're currently in:
    Find out what directory you're currently in:
    List what's in the current directory (short listing, long listing, long listing showing hidden files):
    ls -l
    ls -al
    List what's in a nother directory:
    ls [directoryname]
    ls -l [directoryname]
    ls -al [directoryname]
  4. misterredman macrumors 6502a


    Oct 3, 2007
    I'd like to add that when you don't know the path to a folder or file all you need to do is drag the file or folder in a terminal window. The path will show up automatically.

    So in your case you could write
    cp -R 
    and then paste the source folder in the terminal window. Then paste the destination folder and you have your command.

    If your copy process is interrupted in the middle, you can use the rsync command to complete it, without having to start from scratch.
  5. chown33 macrumors 604

    Aug 9, 2009
    If the file copying doesn't work using the Finder, then the command-line is not likely to work any better. The command-line isn't magic, and there's no improved reliability of data transfers because you're using the 'cp' command.

    If Finder file-copying consistently fails (or even inconsistently fails), maybe the MyBookWorld unit is defective, or your network is unreliable.

    However, there is one command I'd like you enter, and then paste its output into a post here:
    Yup, that's it. Just mount.

    The output should be a list of disks, networked shares, etc. In other words, anything and everything that's currently mounted (including a few things you might not realize are mounted).

    Finally, are you using wired or wireless networking when attempting this massive data transfer? If it's wireless, you might consider switching to wired for the duration of the file transfer.
  6. Robsa thread starter macrumors newbie

    Feb 1, 2009
    Fantastic, thanks very much guys, all replies very useful and much appreciated. :)

    the MyBookWorld volume isnt listed so I assume I need to mount it? its plugged in to my wireless router.

    result of MOUNT command:

    /dev/disk0s2 on / (hfs, local, journaled)
    devfs on /dev (devfs, local, nobrowse)
    map -hosts on /net (autofs, nosuid, automounted, nobrowse)
    map auto_home on /home (autofs, automounted, nobrowse)
    /dev/disk2s0 on /Volumes/XP_PRO_SP3 (cd9660, local, nodev, nosuid, read-only, noowners)
    afp_00yVhe00yVhe00yVhe00yVhe-2.31000006 on /Volumes/Download (afpfs, nodev, nosuid, mounted by robsa)

    I'm thinking it may be something to do with the MyBookWorld using a proprietry OS? I will try plugging the HDD directly in to my laptop - I think I will need a crossover cable for this as the HDD is designed to only be plugged into a router.

Share This Page