The maildir has a specific format of the files laying underneath, e.g. 1549464014.9224_427.hostname:2,RS. In Debian environment copying this file over SSH without renaming is impossible or I don't know how. The question is how?  NOTE: no renaming should be involved!  The example output:  [user@hostname ~]$ scp '1549464014.9224_427.hostname:2,RS' remote.server.com:/dest/dir/ 1549464014.9224_427.hostname:22: [Errno -2] Name or service not known   The solution with quotation like in  is not useful.
122103
I am trying to copy a file that has colons and periods, e.g., with:  scp "test.json-2014-08-07T11:17:58.662378" remote:tmp/  scp test.json-2014-08-07T11\:17\:58.662378 remote:tmp/   and combinations with file:  scp "file:///home/.../test.json-2014-08-07T11:17:58.662378" remote:tmp/   My guess is that scp tries to interprete parts of the file as a server and/or port number. How do I avoid that?  If I rename the file to test.json then scp test.json remote:tmp/ works ok, but not even scp test*62378 remote:tmp/works.
30890
describes how to SSH into a machine that can only be accessed through one or more hosts (that can also be SSH'd into).  Is there an equivalent way of using scp? That is, copy a file to my local machine from the far machine (assuming I have password or key access to all machines along the way)?
36681
I have a couple of files that I want to move to another's user home directory. I don't have permissions to write to that user's home directory, but I know his password.  I know how to copy the file using scp (see ). However, if I want to move the file, copying and then removing the original file is inefficient. Is there a way to move the file, without using sudo (I don't know the root's password)?
63767
I'm trying to copy a small file from another computer in the network using scp, the computer is running Linux Mint 18.3.  I tried from macOS and I get this:  $ scp fyde@192.168.1.211:/home/fyde/Downloads/notes/ubuntu.txt .                           fyde@192.168.1.211's password: \033]4;0;#2b1229\033\\033]4;1;#FFD36D\033\\033]4;2;#6559B6\033\\033]4;3;#E1549E\033\\033]4;4;#788FA3\033\\033]4;5;#778BE1\033\\033]4;6;#D88AA7\033\\033]4;7;#d2d8d2\033\\033]4;8;#939793\033\\033]4;9;#FFD36D\033\\033]4;10;#6559B6\033\\033]4;11;#E1549E\033\\033]4;12;#788FA3\033\\033]4;13;#778BE1\033\\033]4;14;#D88AA7\033\\033]4;15;#d2d8d2\033\\033]10;#d2d8d2\033\\033]11;#2b1229\033\\033]12;#FFD36D\033\\033]13;#d2d8d2\033\\033[s\033[1000H\033[8m\033]708;#2b1229\033\\033[u\033]13;#d2d8d2\033\C0644 6743 ubuntu.txt   I tried from an Ubuntu machine and I get a similar thing:  $ scp fyde@192.168.1.211:/home/fyde/Downloads/notes/ubuntu.txt . fyde@192.168.1.211's password: C0644 6743 ubuntu.txt   I tried with different files and I get the same result, copying from other computers works fine.  Anyone knows what's happening?
60409
I am looping through a number of files, and $file represents the current file.  How can I make copies or renames and keep the extension the same for this current file?  e.g. if $file = x.jpg  How to make a copy of $file's with a filename of x_orig.jpg  So far I have:  for file in /tmp/p/DSC*.JPG; do   cp $file $file+'_orig'.JPG done   but that copies the file  DSCF1748.JPG   to  DSCF1748.JPG+_orig.JPG   whereas I want a copy named  DSCF1748_orig.JPG   Similarly, using cp $file "$file"_orig.JPG  results in files such as DSCF1748.JPG_orig.JPG  I want to get the _orig in the middle of the filename...
121893
I copied a file to my Ubuntu vm with a backslash in the name, and I cannot figure out how to rename the file, e.g. mv .\Dockerfile Dockerfile -- the command line does not like that syntax for the filename but I'm not sure how to escape the .\Dockerfile
38794
I generated a key and copied it to my target:  ssh-keygen ssh-copy-id username@hostname   I left the the location of the key as default and did not set any passphrase.  For a small while after that, I was able to ssh username@hostname without being prompted for a password, and then it stopped working for some reason.
48925
It's hard to search for special characters on google, which is why I'm posting this here.  I recently ran (as root) a mv /tmp/folder/* /* when I meant to run mv /tmp/folder/* ./ Big mistake!  Things broke! A lot of files got mixed up and placed into strange places, none of the normal unix commands worked (ls, dir, cat, etc) and once you logged off, you couldn't ssh back in -- it would give you a prompt, but not accept the old passwords.  Running ls /* shows me that it performs ls on every directory in /. If I tried to draw a parallel, then mv should have simply moved (or copied?) the files to every directory in /. Instead, really weird things happened, and I was just curious what exactly was going on.  More info: The files in /tmp/folder had been transferred from a windows machine, and had been named file (#).txt, where (#) is a number up to two digits, with a space between file and the parenthesis. There were ~40 of these text files.
75492
In a Bash script, I'm trying to store the options I'm using for rsync in a separate variable. This works fine for simple options (like --recursive), but I'm running into problems with --exclude='.*':  $ find source source source/.bar source/foo  $ rsync -rnv --exclude='.*' source/ dest sending incremental file list foo  sent 57 bytes  received 19 bytes  152.00 bytes/sec total size is 0  speedup is 0.00 (DRY RUN)  $ RSYNC_OPTIONS="-rnv --exclude='.*'"  $ rsync $RSYNC_OPTIONS source/ dest sending incremental file list .bar foo  sent 78 bytes  received 22 bytes  200.00 bytes/sec total size is 0  speedup is 0.00 (DRY RUN)   As you can see, passing --exclude='.*' to rsync "manually" works fine (.bar isn't copied), it doesn't work when the options are stored in a variable first.  I'm guessing that this is either related to the quotes or the wildcard (or both), but I haven't been able to figure out what exactly is wrong.
117822
How can I strip out some text from filenames in a folder?  I'm currently attempting:  rename s/"NEWER_(.*?)"//g *   But nothing it getting renamed  I have a parent folder, with a bunch of sub-folders, within are files, that OneDrive thought would be a great idea to append a " (NEWER_timestamp)" to, and I'd like to remove that.  Example File Names:  getyou.ico (NEWER_1417529079.87) o7pm.ico (NEWER_1417529184.89) o7th.ico (NEWER_1417529135.81)
23448
I managed to make a directory literally named ~.  (Apparently, Python's os.mkdir('~/something') does this.)  How do I remove it without nuking my home?  Also, if it helps, I have my real /home on a separate partition. And the duplicate ~ is located in (the real ) ~.
59689
I'm just learning to use sftp, and I want to copy a directory from the remote computer to my local computer. If I try  get [directory]   it gives me this error:  Cannot download non-regular file: /home/mpirocch/Documents   get -R doesn't work, either.
107624
To push a file from a Linux terminal to a Windows system, the following two examples work just fine.  scp /home/user.name/file.html user.name@local.ip.num:/C:/Users/user.name/test_folder/file.html  scp /home/user.name/file.html user.name@local.ip.num:"/C:/Users/user.name/test_folder/file.html"   I need to do this where the local folder has spaces and I cannot change the name,  say /C:/Users/user.name/test folder/  All of the following fail with the message scp: ambiguous target  scp /home/user.name/file.html user.name@local.ip.num:"/C:/Users/user.name/test folder/file.html"  scp /home/user.name/file.html user.name@local.ip.num:"/C:/Users/user.name/test\ folder/file.html"  scp /home/user.name/file.html user.name@local.ip.num:"'/C:/Users/user.name/test\ folder/file.html'"  scp /home/user.name/file.html user.name@local.ip.num:"/C:/Users/user.name/test\\ folder/file.html"  scp /home/user.name/file.html user.name@local.ip.num:"'/C:/Users/user.name/test\\ folder/file.html'"  scp /home/user.name/file.html user.name@local.ip.num:"/C:/Users/user.name/test\\\ folder/file.html"  scp /home/user.name/file.html user.name@local.ip.num:"'/C:/Users/user.name/test\\\ folder/file.html'"   How do I get this to work?
33154
I have this folder structure:  ├── foo1 │   ├── bar1.txt │   └── bar2.txt ├── foo2 │   ├── bar3.txt │   └── bar4 with a space.txt └── foo3     └── qux1         ├── bar5.txt         └── bar6.txt   that I would like to flatten into this, with an underscore between each folder level:  ├── foo1_bar1.txt ├── foo1_bar2.txt ├── foo2_bar3.txt ├── foo2_bar4 with a space.txt ├── foo3_qux1.bar6.txt └── foo3_qux1_bar5.txt   I've looked around and I haven't found any solution that work, mostly I think because my problem has two particularities: there might be more than one folder level inside the root one and also because some files might have spaces.  Any idea how to accomplish this in bash? Thanks!  Edit: Running gleen jackman proposed answer I get this:    There are two underscores for the first level folder. Any idea how to either avoid this or just rename it so that is just one underscore? Thanks.
64318
How do I copy an entire directory into a directory of the same name without replacing the content in the destination directory? (instead, I would like to add to the contents of the destination folder)
18198
Is there a simple way to restrict an SCP/SFTP user to a directory? All methods that I've come across require me to set a chroot jail up by copying binaries, but I don't think that should be necessary.
19823
Possible Duplicate:          I frequently connect to amazon ec2 using their public DNS names (ec2-12-34-56-78.compute-1.amazonaws.com) and because of this my known_hosts file gets overwhelmed with a lot of ec2 entries I will never use again.  I know I could probably use sed -i to edit in place but I wanted to use grep and so I did this:  grep -v ec2 ~/.ssh/known_hosts &gt; ~/.ssh/known_hosts   That leaves known_hosts as an empty file. If I do:  grep -v ec2 ~/.ssh/known_hosts &gt; ~/.ssh/tmp mv ~/.ssh/tmp ~/.ssh/known_hosts   then things are fine, but I am confused why reading and writing to the same file leaves it blank, and if there is any way around this when using grep, cat, etc.