Skip to content
The Chat Archive
Claudeclaude-opus-4-20250514· AnthropicHugging Face LMArena Human Preference 140K

how to copy a folder via ssh to local machine

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with grok-3-preview-02-24’s answer.
  1. User

    how to copy a folder via ssh to local machine

  2. Claude Assistant

    To copy a folder from a remote machine to your local machine via SSH, you can use scp (secure copy) or rsync. Here are the most common methods:

    Using scp

    To copy a folder recursively:

    scp -r username@remote_host:/path/to/remote/folder /path/to/local/destination
    

    For example:

    scp -r user@192.168.1.100:/home/user/documents ~/Downloads/
    

    Using rsync

    Rsync is often preferred for larger transfers as it can resume interrupted transfers and only copies changed files:

    rsync -avz username@remote_host:/path/to/remote/folder /path/to/local/destination
    

    For example:

    rsync -avz user@192.168.1.100:/home/user/documents ~/Downloads/
    

    The flags mean:

    • -a: archive mode (preserves permissions, timestamps, etc.)
    • -v: verbose (shows progress)
    • -z: compress data during transfer

    Additional options

    If you're using a non-standard SSH port:

    scp -P 2222 -r username@remote_host:/path/to/folder /local/path
    rsync -avz -e "ssh -p 2222" username@remote_host:/path/to/folder /local/path
    

    If you have an SSH key in a specific location:

    scp -i ~/.ssh/mykey.pem -r username@remote_host:/path/to/folder /local/path
    rsync -avz -e "ssh -i ~/.ssh/mykey.pem" username@remote_host:/path/to/folder /local/path
    

    Note: Make sure you have the necessary permissions to read the remote folder and write to the local destination.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.