开发者

How to write ONE line of command that scp all the sub-directories in a directory to a remote machine

开发者 https://www.devze.com 2022-12-23 01:40 出处:网络
something like: scp -r all_directories_in_current_directory fenix@xxxxx:~/data 开发者_运维技巧 anyone can give me a clue?scp -r * fenix@xxxxx:~/data

something like:

scp -r all_directories_in_current_directory fenix@xxxxx:~/data
开发者_运维技巧

anyone can give me a clue?


scp -r * fenix@xxxxx:~/data 

If you only want the directories, not the files in the current directory:

scp -r */ fenix@xxxxx:~/data 

This will not copy hidded(names startingwith a . ) directories.


Use rsync rather thsn scp, e.g.

$ rsync -av ./ fenix@xxxxx:data/


Do NFS mount, and do cp -avx.

0

精彩评论

暂无评论...
验证码 换一张
取 消