JC's notes
sharing my journey on linux, one note at a time

Search

Using scp with file names containing spaces

When running a scp command from a bash shell, I realized that the pathnames are interpreted both on the local shell and on the remote one (through the ssh one launched by scp), so you need to escape file names twice.

Examples :

jc@laptop $ scp -P 16000 * jc@server:'"/data/Images/folder with space"'
jc@laptop $ scp -P 16000 * jc@server:'"/data/Images/folder with space"'
jc@laptop $ scp -P 16000 * jc@server:/data/Images/folder\\ with\\ space
jc@laptop $ scp -P 16000 * jc@server:"/data/Images/folder \with \space"
jc@laptop $ scp -P 16000 * jc@server:'/data/Images/folder \with \space'
12 janvier 2014 · jc · Posted in linux · Tagged scp, ssh
← Previous Next →

Articles récents

  • Managing TV overscan on RetroPie (and pretty much any application)
  • VNC plugin for Remmina not found after upgrade
  • Modifying track data in Matroska (mkv) files
  • Splitting a Matroska (mkv) file by chapters
  • Switch buttons on Wacom Graphire on XFCE

Tags