---
title: "The Real Use of SCP Command in Linux"
description: "Here are SCP and CP copy commands in Linux and explained with examples."
url: https://srinimf.com/2023/01/07/scp-command-in-linux-how-to-copy-file/
date: 2023-01-07
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2023/01/pexels-photo-8327472.jpeg?fit=1880%2C1253&ssl=1
categories: ["Linux"]
tags: ["Linux CP Commad", "Linux SCP Command"]
type: post
lang: en
---

# The Real Use of SCP Command in Linux

Here’s the SCP [command in Linux](https://srinimf.com/2022/04/15/the-use-of-df-disk-free-command-in-linux/) copies file from remote server (another server).

Related[Linux ‘su’ these are popular real life examples](https://srinimf.com/2017/10/24/linux-su-these-are-popular-real-life-examples/)

SCP (secure copy protocol) and CP (copy protocol) are two commands in use to copy files. The CP is to copy files within the local server, and the SCP command is to copy the remote server’s file.

The SCP command is interesting one. For instance, the source is available in prod, and to copy the same to the test region, you can use SCP.

## Linux CP command: Copy file within the local server

Here source and destination are two directories located in the same **local server**. In the source directory, a file called test.txt is present. Below you’ll find how the CP command copies the file (in the same server).

![](https://i0.wp.com/srinimf.com/wp-content/uploads/2023/01/image.png?resize=1082%2C417&ssl=1)

## Linux SCP command: Copy file from another server

The SCP command helps you copy the remote server’s file. To understand the SCP command, focus first on the syntax. Here are the parameters present. VIZ: File to copy, user name, remote server address, and local path.

Advertisements

```
$ scp [file_to_be_copied] user_name@[remote_server_name/address_of_server]: [local_server_path]
```

Say, I have a file **sample.txt** in the remote server **xx.xx.xx.xx**. I want to copy the same to the local path (**/home/local**). Here the **abcd** is the user name. The complete command tells how the SCP works to copy a remote file.

```
$ scp sample.txt abcd@xx.xx.xx.xx: /home/local
```

> Tips: I have gone through some of the best manuals and Udemy courses. Here’s the best [SCP manual](https://man7.org/linux/man-pages/man1/scp.1.html) and Udemy course. These helpful for your ready reference.

Related

- [How to Copy HDFS files to Local Linux GET Vs copyToLocal](https://srinimf.com/2021/01/24/how-to-copy-hdfs-files-to-local-linux-get-vs-copytolocal/)DateJanuary 24, 2021
- [Unlock the Power of Unix: Your Ultimate Guide to Daily Commands](https://srinimf.com/2017/02/17/most-popular-daily-use-unix-commands-now/)DateFebruary 17, 2017
- [5 Essential Commands for Navigating Files in UNIX](https://srinimf.com/2014/08/07/unix-daily-5-commands/)DateAugust 7, 2014

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2023%2F01%2F07%2Fscp-command-in-linux-how-to-copy-file%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2023%2F01%2Fpexels-photo-8327472.jpeg%3Ffit%3D1200%252C800%26ssl%3D1&description=The%20Real%20Use%20of%20SCP%20Command%20in%20Linux)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2023/01/07/scp-command-in-linux-how-to-copy-file/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2023/01/07/scp-command-in-linux-how-to-copy-file/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2023/01/07/scp-command-in-linux-how-to-copy-file/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2023/01/07/scp-command-in-linux-how-to-copy-file/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20The%20Real%20Use%20of%20SCP%20Command%20in%20Linux&body=https%3A%2F%2Fsrinimf.com%2F2023%2F01%2F07%2Fscp-command-in-linux-how-to-copy-file%2F&share=email)
-

### Like this:

Like Loading…
