Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Moving a folder from Desktop to the server?

Tags:

terminal

cp

I have a folder in my Desktop. I want to copy it to my server in Terminal.

I tried this unsuccessfully

[~/bin]# cp -r /Users/Sam/Desktop/tig-0.14.1 ~/bin/
cp: cannot stat `/Users/Sam/Desktop/tig-0.14.1': No such file or directory

[edit]

I run the command in my server. The problem seems to be in the fact that "/Users/Sam/Desktop/tig-0.14.1" is a folder in my Mac, not in my server.

Perhaps, I cannot move the folder so simply to my server because my server do not know where my folder locates.

I have always moved the folder by GUI. Is the same possible also just in terminal?

like image 476
Léo Léopold Hertz 준영 Avatar asked Feb 26 '09 17:02

Léo Léopold Hertz 준영


People also ask

How do you move a folder on a server?

To move a server folderOpen the Dashboard. Click STORAGE, and then click Server Folders. From the list of server folders, select the folder that you want to move.

How do I move files to a server?

You can also use the “Move” button to move your files if you know the path to the file location. Select the files you want to move. Right click one of the files to show the options pop up. Type the path to the folder you want to move the files to.

How will you move any file from desktop to the folder?

To use the "Move to Folder" command, select the file by clicking the file name. Click the Edit menu near the top-left of the window and select the Move to Folder option. In the new window browse to the folder you would like to move the file, then click the Move button to move the file to that folder.


3 Answers

From the server:

scp -r [email protected]:~/Desktop/tig-0.14.1/ ~/bin/

username is your shortname on your local mac. A.B.C.D is the IP address of your local mac as seen by the server. You will be prompted for your password.

Or if you wanted to push from your local client:

scp -r ~/Desktop/tig-0.14.1/ [email protected]:~/bin/

serveruser is the user on the server whose ~/bin you want to copy into. W.X.Y.Z is the IP address of the server as seen by your client. You will be prompted to enter serveruser's password.

scp is part of ssh. See 'man scp' (from the terminal) for more info.

like image 156
Nathan Stocks Avatar answered Nov 03 '22 02:11

Nathan Stocks


From your Mac (not the server):

# scp -r ~/Desktop/tig-0.14.1 myUsername@myServerName:~/bin

replace myUsername and myServerName appropriately.

like image 26
eduffy Avatar answered Nov 03 '22 02:11

eduffy


cp is not the correct command. Try scp instead; it has similar use and you can use it like this: (see the manual for reference)

from linux client: scp user1@host1://Users/Sam/Desktop/tig-0.14.1 ~/bin/

if you use a windows client you can use winscp to do this in "drag&drop" style

like image 34
DrFalk3n Avatar answered Nov 03 '22 03:11

DrFalk3n