gamer
gamer

Reputation: 5863

copy folder from server to local machine in ubuntu

I have a folder in my server and I tried to copy it in my local machine like:

scp [email protected]:/path/to/some_folder /my/local/directory

Inside some_folder there is a folder that I want to copy. When I run this command it says

/path/to/some_folder/: not a regular file

How can I copy a folder from server to my local machine. I am using ubuntu 14.04

Upvotes: 1

Views: 18102

Answers (3)

Zekarias Taye Hirpo
Zekarias Taye Hirpo

Reputation: 849

The easiest and the most interactive way is using sftp; you can manipulate the remote server as of your local machine. Let's say you have the following credentials for your remote server:

. Username: root

. ip: 185.48.22.23

1. Step one: Open your file explorer of your ubuntu local machine

2. Step two: Navigate to 'other locations'

3. Step three: Insert your credentials with sftp on the 'Connect to server' box and press 'connect'.

enter image description here

Upvotes: 0

Khawar Islam
Khawar Islam

Reputation: 2924

Easy way, but you need to understand it first. I am using Linux Ubuntu 18.04.4 LTS. To copy a complete folder with children's from Sever to Local Machine

Just go to local machine empty folder directory. Like my is "results" folder contain on desktop

-r == copy entire folder with all flies

khawar == Username on server Machine

223.120.314.49 == Server IP address

-P == Port

22 == Port Number

/data1/khawar1/lpr/Plate_Recognition-LPRnet/ == Complete directory address of server machine folder that you want to copy

results == folder in local machine

scp -r -P 22 [email protected]:/data1/khawar1/lpr/Plate_Recognition-LPRnet/ results

Upvotes: 4

user4448612
user4448612

Reputation:

You can use the -r flag on the scp command

scp -r [email protected]:/path/to/some_folder /my/local/directory

From the manual page:

-r' Recursively copy entire directories. Note that scp follows symbolic links encountered in the tree traversal

Upvotes: 7

Related Questions