Copying Files (to CAEN)

  • In general, you can use the cp command to copy local files:

    cp existing_file new_file

    or directories:

    cp -r existing_directory new_directory

    Similarly can you use the scp command to securely copy files or directories between a local computer and a remote server, such as CAEN.

  • A better command is rsync:

    rsync -a existing new

    Specifying the v option will produce verbose output, printing the names of files it copies:

    rsync -av existing new
  • To copy a file or a directory to or from a remote server (such as CAEN), add your username (uniqname) followed by the host name of the remote server (e.g., login.engin.umich.edu). For example, this is how you could upload the contents of the current director (.) to some directory on CAEN:

    rsync -av . [email protected]:/path/to/directory

    And this is how you could download the contents of some directory on CAEN to your current directory in Terminal:

    rsync -av [email protected]:/path/to/directory .
  • Finally, sometimes you might want to exclude certain files when copying a directory. To copy an entire directory, except for certain files, use the --exclude option For example, to copy the current directory, except for the hidden .git directory that Git creates and except for the hidden .DS_Store file that macOS creates, execute

    rsync -av --exclude .git --exclude .DS_Store . [email protected]:/path/to/directory

results matching ""

    No results matching ""