Home » Linux Command » Linux scp command Help and Examples

Linux scp command Help and Examples

Last updated Sep 4, 2021

SCP stands for Secure Copy, as the name shows it use for securely copy the file, directory from one location to another.

SCP use to copy files securely between networks and system/servers. It uses SSH protocol for authentication and data transfer.

SCP command Syntax:

The syntax of SCP command is very simple, which work with source and destination file path. It is similar like below:
$ scp  source_file_path  destination_file_path

As per the requirement, we can use hostname, port, username, and password with SCP command options.

Here some examples of SCP command which will help you to understand the real use of SCP command.

Suggested Reading: Linux sed command Structure

SCP Command Examples:

Copy a file to remote system

To copy a file into the remote server, you can use source and destination path.

$ scp linuxconcept.pdf satish@linuxconcept.com:.

The above command will copy a linuxconcept.pdf file into satish’s home directory at “linuxconcept.com” system.

Get the detailed information while coping

There is an option “-v” to use to get detailed information while copying the file between host. The option “-v” is used to execute SCP command in verbose mode so that it will print debug information into the screen.

$ scp  -v  linuxconcept.pdf  satish@linuxconcept.com:.

Use specific Port with SCP to connect remote host

To use a specific port with SCP command, you can use the “-P” option, as shown below:

$ scp  -P 44444 linuxconcept.pdf satish@linuxconcept.com:.
satish@linuxconcept.com’s password:
linuxconcept.pdf   100%   4567KB  245.3KB/s   00:21

Related Posts

The 30 most useful Linux commands

This article will introduce some practical and common Linux or Unix command , which is the Linux system administrators normally use the command . This article is not a complete list, but a brief list of commands that can be useful...

15 Practical examples of tcpdump command

15 Practical examples of tcpdump command

The tcpdump is the most essential and powerful command-line network packet sniffing tool. We use it to analyze network packets, capture or filter TCP/IP packets that transferred and received over the network on a specific network interface. It is available in almost...

15 Useful “df” Commands to Check Disk Space in Linux

15 Useful “df” Commands to Check Disk Space in Linux

There are several Linux tools available on the internet to check disk space utilization; we can use any of them. But, Linux has a best built-in command-line utility called “df”. The “df” is the short form of “disk filesystem”, we can get detailed information on used...

15 Practical examples of echo command

15 Practical examples of echo command

If you are writing a bash script, you know echo command very well. It is use to display text lines on an output screen or a file. The echo command is the most common command used by all Linux users, and it is built-in Linux command. echo command syntax: echo...

Follow Us

Our Communities

More on Linux Command

The Ultimate Managed Hosting Platform
Load WordPress Sites in as fast as 37ms!

0 Comments

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

two × two =

Shares