Linux Commands(I) scp
1. scp is Secure Copy.
Copy the file from a remote host to the local host
>scp luohua@remote.server.com:/home/luohua/server.txt /home/luohua/tmp/server.txt
Copy the directory "client" from the local host to a remote host's directory "server"
>scp -r client luohua@remote.server.com:/home/luohua/server
Some other examples
Copy the file "foobar.txt" from remote host "rh1.edu" to remote host "rh2.edu"
>scp your_username@rh1.edu:/some/remote/directory/foobar.txt your_username@rh2.edu:/some/remote/directory/
Copying the files "foo.txt" and "bar.txt" from the local host to your home directory on the remote host
>scp foo.txt bar.txt your_username@remotehost.edu:~
Copy multiple files from the remote host to your current directory on the local host
>scp your_username@remotehost.edu:/some/remote/directory/\{a,b,c\} .
>scp your_username@remotehost.edu:~/\{foo.txt,bar.txt\} .
2. Test to run them in shell script
>vi data_import.sh
#!/bin/sh
echo "step1 start.................."
scp luohua@remote.server.com:~/server.txt ./t1.txt
echo "step1 end...................."
echo "step2 start.................."
wget http://www.baidu.com
echo "step2 end...................."
references:
http://www.hypexr.org/linux_scp_help.php
http://www.computerhope.com/unix/wget.htm
1. scp is Secure Copy.
Copy the file from a remote host to the local host
>scp luohua@remote.server.com:/home/luohua/server.txt /home/luohua/tmp/server.txt
Copy the directory "client" from the local host to a remote host's directory "server"
>scp -r client luohua@remote.server.com:/home/luohua/server
Some other examples
Copy the file "foobar.txt" from remote host "rh1.edu" to remote host "rh2.edu"
>scp your_username@rh1.edu:/some/remote/directory/foobar.txt your_username@rh2.edu:/some/remote/directory/
Copying the files "foo.txt" and "bar.txt" from the local host to your home directory on the remote host
>scp foo.txt bar.txt your_username@remotehost.edu:~
Copy multiple files from the remote host to your current directory on the local host
>scp your_username@remotehost.edu:/some/remote/directory/\{a,b,c\} .
>scp your_username@remotehost.edu:~/\{foo.txt,bar.txt\} .
2. Test to run them in shell script
>vi data_import.sh
#!/bin/sh
echo "step1 start.................."
scp luohua@remote.server.com:~/server.txt ./t1.txt
echo "step1 end...................."
echo "step2 start.................."
wget http://www.baidu.com
echo "step2 end...................."
references:
http://www.hypexr.org/linux_scp_help.php
http://www.computerhope.com/unix/wget.htm