scp command example

How to use SCP command in Linux to copy a file from one server to another. it is used to secure copy a file to or from a remote server. Linux the essential for DevOps Roles.

SCP command example

Copy file from one client location to another server location

$ scp /tmp/local.conf huupv@192.168.1.22:/home/huupv

Use “-r” recursive option to copy directory and sub-directories.

$ scp -r huupv@192.168.1.22:/home/huupv/* ./your-workspace

To copy the remote file to the local directory

$ scp huupv@192.168.1.22:/home/huupv/file-remote.txt /local/folder

Copying a local file to remote directory

$ scp local-text.txt huupv@192.168.1.22:/home/huupv

Using key files like ssh command 🙂

$ scp -i your_key.pem local-text.txt huupv@192.168.1.22:/home/huupv

Conclusion

Thought the article, you can use “SCP command example” as above. I hope will this your helpful. Thank you for reading the DevopsRoles page!

,

About HuuPV

My name is Huu. I love technology and especially Devops Skill such as Docker, vagrant, git so forth. I likes open-sources. so I created DevopsRoles.com site to share the knowledge that I have learned. My Job: IT system administrator. Hobbies: summoners war game, gossip.
View all posts by HuuPV →

Leave a Reply

Your email address will not be published.

Comment moderation is enabled. Your comment may take some time to appear.

This site uses Akismet to reduce spam. Learn how your comment data is processed.