🧠
MY SECOND BRAIN
meBlogLinkedInGitHub
  • Second brain
  • AI - Artificial Intelligent
    • AI-labeling
    • AI-training
  • Books
  • Code
    • Linux
    • Gradle
  • Company
    • Interview
  • Computer science
    • Data Structures
    • Algorithms
    • Concurrency
  • Container
    • Docker
      • Docker | Private Docker Registry
    • Kubernetes
  • Distributed systems
    • Akka
    • Analytics
    • Delivery guarantee
    • Kafka
    • Rebalancing
    • RPC
      • gRPC
  • Food
    • Recipes
      • Tiramisu
  • Git
  • GH CLI
    • GH CLI | Pull Request
  • SSH
    • SSH bastion | SSH Jump host
    • SCP
  • Learning
  • Management
  • Reactive systems
  • System Design
    • CAP Theorem
    • Domain Driven Design
    • System Design Interview
    • Load Balancing
    • CDN
  • OCR
  • Productivity
    • Alfred
  • Health
    • Teeth
  • Devops
  • Data stores
    • Elasticsearch
    • Mongo
  • Germany
    • Berlin
      • Where is to buy Christmas trees in Berlin
    • Internet in Germany
      • Install custom router for telekom
  • Transport
    • Bikes
  • Travel
    • Russia
      • Moscow
        • Moscow Attractions
    • United Kingdom
  • Writing
    • Markdown
      • Markdown Tables
  • Programming languages
    • Java
      • Java | OCR
      • Java | Spring
      • JAVA | How to install multiple Java versions on macOS
    • Go
    • Kotlin
    • Python
  • Optimization
    • Email
      • Zero inbox
  • Finance
    • Investment
      • Online brokers
  • People
  • Security
    • SaaS Security
  • Unix
    • Shell
      • ZSH
  • Work
    • Feedback
Powered by GitBook
On this page
  • Syntax
  • SCP copy local file to remote system
  • SCP copy local file to remote with output path
  • SCP copy local file under remote folder
  • SCP copy local folder to remote folder
  • SCP copy remote file to local system
  • SCP copy files between two remote systems
  • SCP options
  1. SSH

SCP

Syntax

scp [OPTION] [user@]SRC:]file1 [user@]DEST:]file2

where is

  • OPTION – options which accept the command: ssh configuration, recursively, etc

  • SRC – is a source source host

  • DEST – is a destination host

SCP copy local file to remote system

SCP copy local file to remote with output path

scp /mnt/test/test.txt ubuntu@10.130.10.10:/home/ubuntu/test_folder/myfile.txt

This command will copy test.txt to the remote file, you could provide another name filename for remote system

SCP copy local file under remote folder

scp /mnt/test/test.txt ubuntu@10.130.10.10:/home/ubuntu/test_folder

This command will copy the test.txt under the test_folder on remote machine with the same filename as original

SCP copy local folder to remote folder

scp /mnt/test ubuntu@10.130.10.10:/home/ubuntu/test_folder

All files from /mnt/test will be copied recursively under the test_folder

SCP copy remote file to local system

scp ubuntu@10.130.10.10:/home/ubuntu/test_folder/myfile.txt /mnt/test/remote_file.txt

SCP copy files between two remote systems

scp ec2-user@18.135.23.123:/opt/my_folder/test.txt ubuntu@10.130.10.10:/home/ubuntu/myfile.txt

SCP options

  • -r – copy recursively

  • -P – specifying the SSH port (default: 22)

PreviousSSH bastion | SSH Jump hostNextLearning

Last updated 3 years ago