2010년 1월 27일 수요일

ssh 이용하여 파일 복사하기

출처 : http://forums.applenova.com/showthread.php?t=21249

push

ssh user@host cat < "local file name" ">" "remote file name"

ssh root@192.168.68.2 cat < "/231.gif" ">" "/231.gif"


pull

ssh user@host cat "remote file name" > "local file name"

ssh root@192.168.68.2 cat "/231.gif" > "/231.gif"

compare

ssh user@host cat < "remote file name" "|" diff - "local file name"

ssh root@192.168.68.2 cat < "/231.gif" "|" diff - "/231.gif"

또는

scp sourceuser@sourcehost:sourcepath/filename destinationuser@destinationhost:destinationpath/filename

scp sourceuser@sourcehost:sourcepath/filename destinationpath/filename

또는

ssh $SERV$comnm tail -66349 $dir$case$tailnm[$i]/depscon.out > depscon.dat$i