How do I copy all files with scp in 1 command?

Neil Watson tlug-neil-8agRmHhQ+n2CxnSzwYWP7Q at public.gmane.org
Wed May 15 22:35:12 UTC 2013


On Wed, May 15, 2013 at 03:10:51PM -0400, waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org wrote:
>  I'm mostly finished setting up a new desktop PC, after which an
>ancient PC will go to the York Region ewaste centre.  One problem I ran
>into whilst copying over files is that "dot-files", e.g. .bash_profile
>and .bashrc are not copied over when I specify "*".  What I ended up
>doing was...
>
>scp * new_machine:/home/waltdnes/
>scp \.* new_machine:/home/waltdnes/

Try this:
tar -cf - * .* | ssh host 'tar -xf -'

-- 
Neil Watson
Linux/UNIX Consultant
http://watson-wilson.ca
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list