LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-12-2010, 05:33 AM   #1
Volcano
Member
 
Registered: Sep 2005
Posts: 225

Rep: Reputation: 15
how to download a file ...get command ?


I have logged into the shell using putty . I am now here...

axktij09:admin:/temp/app/jfg/khgjkqrstit01>



My Objective :
I want to download a remote file to my local hard disk.



source file:/temp/app/jfg/khgjkqrstit01/YourInside/pages/a.jsp


destination D:\YourInside\pages


what command I need to fire from the shell ? I think I need to use 'get' ...but I am not sure what to write for my case.

N.B : This could be overwrite download . As I have a copy of the same file in the destination directory.

Last edited by Volcano; 01-12-2010 at 05:42 AM.
 
Old 01-12-2010, 06:13 AM   #2
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 572

Rep: Reputation: 120Reputation: 120
How are you logged in? telnet, ssh?

Does your server have either ftp or ssh enabled? If so, look up the ftp and scp commands.
 
Old 01-12-2010, 06:14 AM   #3
Volcano
Member
 
Registered: Sep 2005
Posts: 225

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by devnull10 View Post
How are you logged in? telnet, ssh?

Does your server have either ftp or ssh enabled? If so, look up the ftp and scp commands.

putty + SSH


Quote:
oes your server have either ftp or ssh enabled?
Yes. FTP enabled.

Can you please tell me what command to fire ?

Last edited by Volcano; 01-12-2010 at 06:15 AM.
 
Old 01-12-2010, 06:16 AM   #4
Dave_Devnull
Member
 
Registered: May 2009
Posts: 142

Rep: Reputation: 24
Personally I would use 'scp', but as you are using Putty I would not know how to deal with the local (Windows?) end of things. I'm assuming Windows as I can't see any reason to run Putty if you have an ordinary *nix shell available. With that in mind take a look at WinSCP for doing drag/drop type copies between Win/Lin over a network.

Hope that helps.
 
Old 01-12-2010, 06:18 AM   #5
Volcano
Member
 
Registered: Sep 2005
Posts: 225

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Dave_Devnull View Post
Personally I would use 'scp', but as you are using Putty I would not know how to deal with the local (Windows?) end of things. I'm assuming Windows as I can't see any reason to run Putty if you have an ordinary *nix shell available. With that in mind take a look at WinSCP for doing drag/drop type copies between Win/Lin over a network.

Hope that helps.
if you are using putty , you just get a command console ....this is just as similar you fire a telnet command from windows command prompt.

What I need is a proper FTP command to shoot from the remote console .

Here is a BAD/ IMAGINARY ftp command .

ftp - source /temp/app/jfg/khgjkqrstit01/YourInside/pages/a.jsp -destination D:\YourInside\pages

I probabily need something like that to shoot ...can you correct it ?

Last edited by Volcano; 01-12-2010 at 06:21 AM.
 
Old 01-12-2010, 06:23 AM   #6
manavendra
LQ Newbie
 
Registered: May 2009
Location: Bangalore, India
Distribution: Kubuntu 2.6.31-14
Posts: 19

Rep: Reputation: 2
You can use the wget command to download the file to your putty client's server.

wget [URL]
For example,

Code:
manav@manav-workstation:~$ wget "http://www.emea.europa.eu/pdfs/human/comp/opinion/45024308en.pdf"
After this, to copy/move this file from server to your local hard disk, you can use winscp on your Windows and browse both local and remote directories.
 
Old 01-12-2010, 08:34 AM   #7
Dave_Devnull
Member
 
Registered: May 2009
Posts: 142

Rep: Reputation: 24
Keep in mind when you are logged in with Putty, you are on a *remote* system. Put it this way, if you were sat at a Linux server in one place, how would that server access your windows box from that server? Could you ftp into it from that Linux box? Does the windows machine have an ftp server running on it? Does it have a scp service running on it? Probably not.

You have a couple of options, but the easiest would be to use WinSCP: http://winscp.net/eng/index.php
{this tutorial: http://www.spampig.org.uk/drwaffleone.php is unrelated, but at the foot of the page details using WinSCP for what you want}

Or, you can download the putty additional program: "pscp" and run something like this from a windows command prompt:

Quote:
"c:\program files\putty\pscp" user@host:/tmp/a.a e:\downloads\
{shamelessly stolen from somewhere else}
 
Old 01-12-2010, 08:49 AM   #8
nuwen52
Member
 
Registered: Feb 2009
Distribution: Debian, CentOS 5, Gentoo, FreeBSD, Fedora, Mint, Slackware64
Posts: 208

Rep: Reputation: 46
pscp is available in the full PuTTY package that I use. But, there is no graphical interface so you have to run it from the command line (as Dave_Devnull) stated. scp (pscp in this case) is built into ssh and connects through the ssh daemon on the server. So, you need no other programs to do this. This, to me, would be the best way.
 
Old 01-12-2010, 09:27 AM   #9
Dave_Devnull
Member
 
Registered: May 2009
Posts: 142

Rep: Reputation: 24
It brings us back to what Putty itself is. It's a remote client. So the OP needs to ask himself "If I was sat in front of that Linux server, how could I access that Windows machine?"

The command to run if the OP wants to do it from a Windows command prompt;
1. cd into the directory where 'pscp.exe' is located (of not in the path) - in my example it's in C:\putty
2. Run:

C:\putty>pscp user1@1.2.3.4:/home/user1/the_remote_file_you_want .

Where user1 is the username used to log into the remote server
1.2.3.4 is the ip address or hostname of the remote server

This will prompt for the remote server's password for 'user1', and the file will then download into the current directory on the Windows box (signified by the '.' on the end of the statement)

C:\putty>dir

Should show it.

Hope that helps, but there is more info here:
http://www.linuxquestions.org/questi...4/#post1084922

Last edited by Dave_Devnull; 01-12-2010 at 09:29 AM.
 
Old 01-12-2010, 11:35 AM   #10
Volcano
Member
 
Registered: Sep 2005
Posts: 225

Original Poster
Rep: Reputation: 15
comments are in bold

Quote:
Originally Posted by Dave_Devnull View Post
It brings us back to what Putty itself is. It's a remote client. So the OP needs to ask himself "If I was sat in front of that Linux server, how could I access that Windows machine?"

The command to run if the OP wants to do it from a Windows command prompt;
1. cd into the directory where 'pscp.exe' is located (of not in the path) - in my example it's in C:\putty
2. Run:

C:\putty>pscp user1@1.2.3.4:/home/user1/the_remote_file_you_want .

don't we need to use port number here ? In putty when I login i normally choose port = 22 and SSH ...Don't we need to write down port number in your command ?

Where user1 is the username used to log into the remote server
1.2.3.4 is the ip address or hostname of the remote server

This will prompt for the remote server's password for 'user1', and the file will then download into the current directory on the Windows box (signified by the '.' on the end of the statement)

C:\putty>dir

but I wanted to send it to the D:\YourInside\pages folder . so, this seems I need to copy manually again to my desired directory ...can't I downloadload the file directly to the destination folder ?

Should show it.

Hope that helps, but there is more info here:
http://www.linuxquestions.org/questi...4/#post1084922

Last edited by Volcano; 01-12-2010 at 11:36 AM.
 
Old 01-12-2010, 08:53 PM   #11
Volcano
Member
 
Registered: Sep 2005
Posts: 225

Original Poster
Rep: Reputation: 15
any comments ?
 
Old 01-12-2010, 11:26 PM   #12
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Expanding on Dave_Devnull :
Code:
c:/somedir>pscp user1@1.2.3.4:/home/user1/the_remote_file d:/some_other_dir/
No port reqd, scp is part of the ssh pkg and assumes port 22 unless otherwise directed.
K.I.S.S.
 
Old 01-13-2010, 01:43 AM   #13
Volcano
Member
 
Registered: Sep 2005
Posts: 225

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by chrism01 View Post
Expanding on Dave_Devnull :
Code:
c:/somedir>pscp user1@1.2.3.4:/home/user1/the_remote_file d:/some_other_dir/
No port reqd, scp is part of the ssh pkg and assumes port 22 unless otherwise directed.
K.I.S.S.
This works if the file is NOT present in local hard disk.

but If the file is present in local hard disk then it throws an error ' Cannot create file' ...So, can you modify the command so that it can include overwrite file download ? is it possible ? it may ask 'Y' or 'N' for overwrite .
 
Old 01-13-2010, 01:49 AM   #14
Dave_Devnull
Member
 
Registered: May 2009
Posts: 142

Rep: Reputation: 24
What does the documentation/manual say?

http://the.earth.li/~sgtatham/putty/.../Chapter5.html
 
Old 01-13-2010, 02:16 AM   #15
Volcano
Member
 
Registered: Sep 2005
Posts: 225

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Dave_Devnull View Post
What does the documentation/manual say?

http://the.earth.li/~sgtatham/putty/.../Chapter5.html
ok ... looks like this facility is not available in the manual .

I was looking for "interactive" and "overwrite" options ...but none present there.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu 8.10 and want to download 2 GB file in command line. chandan766 Linux - Newbie 12 04-06-2009 09:37 AM
unable download the file through "put" command for anonymous user roni_atx Linux - General 3 11-20-2008 03:15 AM
Fast Download Site for Linux, enables >4GB Download of single file TigerLinux Linux - Distributions 9 10-29-2005 12:45 PM
How to Download File in Command Mode notooth Linux - General 3 05-25-2005 04:28 PM
Konqueror wont download download TAR,ZIP file but preview Velocide Linux - Newbie 0 03-22-2004 06:07 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration