Skip to content

Instantly share code, notes, and snippets.

@ayoola-moore
Forked from dehamzah/scp-cheatsheet.md
Created December 17, 2018 04:36
Show Gist options
  • Select an option

  • Save ayoola-moore/a595a857b7c1af6a94bc577a62256a1a to your computer and use it in GitHub Desktop.

Select an option

Save ayoola-moore/a595a857b7c1af6a94bc577a62256a1a to your computer and use it in GitHub Desktop.

Revisions

  1. @dehamzah dehamzah revised this gist Dec 19, 2016. 1 changed file with 47 additions and 3 deletions.
    50 changes: 47 additions & 3 deletions scp-cheatsheet.md
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,56 @@
    ## Basic Syntax

    ```
    $ scp source_file_name username@destination_host:destination_folder
    $ scp source_file_path destination_file_path
    ```

    ### Provide Information about whats going on with `-v` parameter
    ### Uploading

    Single file
    ```
    $ scp -v source_file_name username@destination_host:destination_folder
    $ scp ~/my_local_file.txt user@remote_host.com:/some/remote/directory
    ```

    Multiple files
    ```
    $ scp foo.txt bar.txt username@remotehost:/path/directory/
    ```

    ### Downloading

    Single file
    ```
    $ scp user@remote_host.com:/some/remote/directory ~/my_local_file.txt
    ```

    Multiple files
    ```
    $ scp username@remotehost:/path/directory/\{foo.txt,bar.txt\} .
    ```


    ### Extra Options

    #### Verbose Output

    ```
    $ scp -v source_file_path destination_file_path
    ```

    #### Copy Entire Directory (Recursively)

    ```
    $ scp -r source_file_path destination_file_path
    ```

    #### Speed Up Transfer with Compression

    ```
    $ scp -C source_file_path destination_file_path
    ```

    #### Specify Identity File

    ```
    $ scp -i private_key.pem ~/test.txt [email protected]:/some/path/test.txt
    ```
  2. @dehamzah dehamzah created this gist Dec 19, 2016.
    12 changes: 12 additions & 0 deletions scp-cheatsheet.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    ## Basic Syntax

    ```
    $ scp source_file_name username@destination_host:destination_folder
    ```

    ### Provide Information about whats going on with `-v` parameter

    ```
    $ scp -v source_file_name username@destination_host:destination_folder
    ```