SCP and path with spaces under Linux

1 points
Created by:

How can I copy file with spaces with SCP under Linux?

Let's say we have file with two spaces like this:

/home/my_file version 123.csv

In order to copy this file with spaces using SCP we need to:

  1. Entire path enclose in double quotes.
  2. Before each space we need to put double backslash: \\

Example of working SCP command:

scp root@"/home/my_file\\ version\\ 123.csv" .

This command will simply copy our file with spaces from server with IP: to server from which we execute above command.

Native Advertising
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

ÔŁĄ´ŞĆ­čĺ╗ ­čÖé