Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to download a file to my local computer Windows 7 in my server in Shell using UNIX command.

Is there a way to do this?

I also have Ubuntu installed on my computer. Do I need to do another method for downloading a file from my server from shell?

I was wondering if this can be done without using GUI software.


share|improve this question

migrated from Mar 15 '12 at 23:12

This question came from our site for professional and enthusiast programmers.

Your question is unclear. "" is either redundant or backwards. If you just want to download a file use wget. What is the source and destination? – technosaurus Mar 16 '12 at 5:02

I'd suggest you look at scp, which comes preinstalled with your Ubuntu installation, as part of SSH.

Knowing the path of the file you simply do:

scp suser@sip:/location/of/file .

scp will copy the file, and the . means copy to the current folder on your local machine, where
suser is your user on your server(!) and
sip is your server's IP.

If it's a folder you need scp -r instead of scp in the above.
If after the : you have a / like above, it's the location relative to the root / of the file system. If you omit the first / it's the location relative to your user's home directory.

It will ask you for the password for your user on the server.

share|improve this answer
This will work when copying files between Unix-like machines (provided you have ssh set up), but on Windows 7 this requires something like Cygwin (as Aditya Naidu points out). – user55325 Mar 16 '12 at 7:04
Yes, but the user stated he was talking about a linux server and he mentioned he als had ubuntu installed on his local computer (or so I understand it). It is easier to do from ubuntu. – miyalys Mar 16 '12 at 8:44
I added the information to install ssh/scp. – miyalys Mar 16 '12 at 8:56
I believe ssh is preinstalled. You may need openssh-server on the linux server. pscp, which comes with putty would be a good client on windows. – Journeyman Geek Mar 29 '12 at 13:37

You can install cygwin on your Windows machine and run sshd in cygwin. Then you can scp files either ways from either of the machines.

share|improve this answer

You must log in to answer this question.