Re: how to copy filename with spaces using scp

From: John Davidorff Pell (johnpell_at_mac.com)
Date: 01/14/04

  • Next message: Gerald C.: "Re: logout from ssh session"
    Date: Tue, 13 Jan 2004 21:14:50 -0800
    
    
    

    On Jan 13, 2004, at 4:01 PM, Joe Smith wrote:
    > On Thu, Dec 11, 2003 at 09:23:37PM -0500, Jerry Geis wrote:
    >> I am wondering how I would issue a command using scp
    >> to copy a file that has spaces in the filename.
    > I tend to use rsync over ssh for stuff like that.
    >
    > host-a% rsync -av -e ssh source_dir/ user@host-b:dest_dir/
    >
    > Rsync handles filenames with spaces, directorynames with spaces,
    > and does not re-copy files that have already been transfered
    > to the destination. It also works great for log files, by
    > transferring new appended data instead of copying the whole file.
    > -Joe

    This issue has been repeatedly argued over on many lists. The gist is:
    if you want to use scp, then u need to "double excape" the file name,
    i.e. scp "file name with spaces.txt" remote:"new\ file\ name.txt"

    hope this helps,
    JP

    --
    "The New York Times is read by the people who run the country. The 
    Washington Post is read by the people who think they run the country. 
    The National Enquirer is read by the people who think Elvis is alive 
    and running the country ..."
    -- Robert J Woodhead
    
    



  • Next message: Gerald C.: "Re: logout from ssh session"

    Relevant Pages

    • Re: how to copy filename with spaces using scp
      ... > I am wondering how I would issue a command using scp ... > to copy a file that has spaces in the filename. ... I tend to use rsync over ssh for stuff like that. ... transferring new appended data instead of copying the whole file. ...
      (SSH)
    • Re: Copy mailertable.db access.db generics.db etc etc ....
      ... find I am I complete rookie when it comes to scp and rsync. ... use rsync with ssh or scp with ssh and thats as far as I get. ... I use cfengine here so no cron job is needed, but scp and rsync will work fine along with the cron process. ...
      (comp.mail.sendmail)
    • Re: Compiling scp statistics
      ... Or you could use rsync over ssh. ... >> We have a script that uses scp to copy weblog files from ... i.e. whether the transfer was successful. ... > way to capture the throughput figures (the progress meter is only sent ...
      (SSH)
    • Re: Re: [Q] distribution of patched binaries for security fixes.
      ... > scp, rsync, cvsup, 'make release' to make a full installation mirror, ... Here i make heavy use of rsync + scp tu update my web sites mirror. ...
      (FreeBSD-Security)
    • Re: [opensuse] Upload/download files from public domain using Apache server
      ... do user authentication and file transfer in a secure way, like sftp. ... If your users need point and click, then I would recommend that you set up vsftp. ... then have them use scp or rsync. ...
      (SuSE)

  • Quantcast