Scp spaces in file
Improve this question. AlexPandiyan AlexPandiyan 3, 2 2 gold badges 13 13 silver badges 10 10 bronze badges. Double check that the file really exists. Put the quotes around the whole path, including the login name and ip address. Alternatively, remote the quotes and prepend the space with a backslash instead. Add a comment. Active Oldest Votes. Basically you need to escape it twice, because it's escaped locally and then on the remote end.
There are a couple of options you can do in bash : scp user example. Improve this answer. Adrian Gunawan Adrian Gunawan This is pretty minor, but on a Mac and in most console apps like Terminal, there is a 'Paste Escaped Text' option. I therefore used the second option. That's probably the single most ridiculous program behaviour I've seen! The fact that what you put there is a shell command argument allows you to do stuff like scp user example.
In general, I prefer this over having convenience with files that have spaces. Files with spaces are always a bother. Show 6 more comments. So when it gets to the remote the remote is looking for a string with unescaped quotes and it fails To see this in action, start a shell with the -vx options ie bash -vx and it will display the interpolated version of the command as it runs it. Navin 3, 2 2 gold badges 24 24 silver badges 49 49 bronze badges. Vorsprung Vorsprung Using single quotes and escaping worked for me but not double quotes — Mauricio Trajano.
MauricioTrajano take a look at gnu. In the simple case above double " or single ' work the same — Vorsprung. Learn more. SCP command with spaces and a comma Ask Question. Asked 11 years, 5 months ago. Active 11 years, 5 months ago. Viewed 3k times. Any help or suggestions welcome. Improve this question. EEAA k 17 17 gold badges silver badges bronze badges. Relequestual Relequestual 3 3 silver badges 14 14 bronze badges. It should work, and it didn't and that frustrates me.
I want to learn! Add a comment. Active Oldest Votes. Improve this answer. Crwth Crwth 3 3 bronze badges. Thanks for your answer. Tab doesn't work with scp. Correct I understand I should have used the -r flag.
Still, when I tried to do an exact file, it said it couldnt be found, and yet I could go directly to that directory and see it there Relequestual: tab completion is a function of the shell you are using. When I attempted the transfer, I used the following command: scp [remote username] Can someone fill me in on what I'm doing wrong here? Improve this question. Alcuin Arundel Alcuin Arundel 2, 2 2 gold badges 17 17 silver badges 28 28 bronze badges.
Main lesson here: quit using spaces in file names. Even Apple corporation agrees on this now: support. That's fine, unless you're scp'ing files that you didn't name. Add a comment. Active Oldest Votes.
There are 3 possibilities that you could try: scp [remote username] All should work but some are syntactically easier to understand than others References: How to escape spaces in path during scp copy in linux?
Improve this answer. Please leave a comment to start the discussion. Please keep in mind that all comments are moderated and your email address will NOT be published. Save my name, email, and website in this browser for the next time I comment. Don't subscribe All Replies to my comments Notify me of followup comments via e-mail. You can also subscribe without commenting. Escape Spaces in Path Names for Scp Command The following image shows a familiar error that is encountered when using the scp command with spaces in file or folder names.
0コメント