cp - copy command

cp  is used to copy files and directories
$ cp [options] source dest
cp /c/users/iman/Desktop/images/*.jpg /e/test/

copy a directory / copy the images folder into test folder
cp - r /c/users/iman/Desktop/images/ /e/test/

cp command main options:
option     description
cp -a     archive files
cp -f     force copy by removing the destination file if needed
cp -i     interactive - ask before overwrite
cp -l     link files instead of copy
cp -L     follow symbolic links
cp -n     no file overwrite
cp -R     recursive copy (including hidden files)
cp -u     update - copy when source is newer than dest
cp -v     verbose - print informative messages

 scp

scp stands for "secure copy." “copy source_file_name”

into “destination_folder” at “destination_host” using “username account”.

scp source_file_name username@destination_host:destination_folder

$ scp source_file_path destination_file_path

Depending on the host, the file path should include the full host address, port number, username and password along with the directory path.
So if you are "sending" file from your local machine to a remote machine (uploading) the syntax would look like this

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

When copying file from remote host to local host (downloading), its looks just the reverse

$ scp user@remote_host.com:/some/remote/directory ~/my_local_file.txt # just download the file $ scp user@192.168.1.3:/some/path/file.txt .

Transfer multiple files
Multiple files can be specified separated by a space like this

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

Copy entire directory (recursively)

To copy an entire directory from one host to another use the r switch and specify the directory

$ scp -v -r ~/Downloads root@192.168.1.3:/root/Downloads

Copy files across 2 remote hosts
Scp can copy files from 1 remote host to another remote host as well.

$ scp user1@remotehost1:/some/remote/dir/foobar.txt user2@remotehost2:/some/remote/dir/