How to Copy a Directory from One Server to Another in Ubuntu/Linux

You can use the below scp command to copy an entire directory or a specific file from one linux based server to another:

				
					scp -i {keyfile} -r {origin} {destination}
				
			

Example:1

				
					scp -i yourpem.pem -r username@ip_address_of_remote_server:/remote_directory_path destination_direction_path
				
			

Example:2

				
					scp -i yourpem.pem -r root@111.111.111.111:/home/abc /home/efg
				
			
How to Copy a Directory from One Server to Another in Ubuntu/Linux
Scroll to top