How to exclude file when using scp command recursively

last updated in Categories , , ,

I need to copy all the *.c files from local laptop named hostA to hostB including all directories. I am using the following scp command but do not know how to exclude specific files (such as *.out):
$ scp -r ~/projects/ user@hostB:/home/delta/projects/
How do I tell scp command to exclude particular file or directory at the Linux/Unix command line?
Continue reading “How to exclude file when using scp command recursively”

Linux / Unix: scp Copy All Hidden Dot Files

last updated in Categories ,

I‘m using scp command to copy files from one server to another server. The problem is that I’m unable to copy all hidden files (such as .bash_history). How do I copy hidden files using the scp command under Unix like operating systems?

Linux / UNIX: scp / rsync File Name With a Colon (:) In It

last updated in Categories , ,

How do I copy a file with a colon punctuation (:) name in it. When I type the following command to copy “file:name.txt” to a remote host called server1:

scp file:name.txt user@server1:/path

I get the following error:

ssh: Could not resolve hostname s: Name or service not known

How do I copy file with scp or rsync with a colon in it?