Sunday, September 25, 2011

Linux server copy command

In Linux / UNIX if you want to copy a file or a directory recursively from one server to other server you can use SCP (server copy) command

Synatax :

scp <filename> userName@server:/home/path/


scp -r <foldername> userName@server:/home/path/

It will promt for a password, after entering correct password it will copy files or a directory recursively from specified source server to specified destination server.

Options available :

  • -p : Preserves the modification and access times, as well as the permissions of the source-file in the destination-file
  • -q : Do not display the progress bar
  • -r : Recursive, so it copies the contents of the source-file (directory in this case) recursively
  • -v : Displays debugging messages