Using the Linux command line, I use the scp command to copy up all the files and folders from a certain directory. However, I don't like to consume wasted bandwidth for copying up things I rarely change like my tiny_mce folder. What's the trick to copy up everything but skip a short list of folders?

6 Answers
6

rsync works fine, and in most cases, uses SSH automatically as it's transport protocol. It will compare files and only upload those that have changed - but you can also use an exclude list to specify files in the tree that shouldn't be rsynced anyhow.

Using rsync --exclude is the more obvious choice here, but if you really want to just send a few files or folders and have something specific to exclude, you can use shell globing with scp. First make sure you have the right globing options set in your shell. For bash run shopt -s extglob and for zsh use setopt ksh_glob. Then something like this: