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 have a remote host called myhost and I have some log files that I want to access in the terminal.

For example, I can access this in my browser:

file://myhost/f$/logs/dev.log

But when I try this in the terminal

scp -p "username@myhost:/f$/logs/dev.log" "/home/Documents"

it gives me the 'cannot stat' error:

cp: cannot stat `username@myhost:/f$/logs/dev.log': No such file or directory

I have tried using username@file://myhost and username@//myhost but still no luck.

Any ideas?

Thanks in advance!

share|improve this question
3  
Were exactly is the file stored on your remote host (from /)? Just because it's in myhost/f$/logs/dev.log in your browser does not mean it's in the same spot relative to user-login. Second question is, can you ssh in fine? – nerdwaller Oct 30 '12 at 15:46
    
Your error message says `username@myhost:/f$/logs/dev.lo' (note missing g at the end). Is that a typo in the error message or the cause of your problem? – Dennis Oct 30 '12 at 16:01
    
The remote host is another machine shared within the network. And yes I can ssh into the machine using the same username but it is strongly not recommended. So maybe that's the problem here? – John Powel Oct 30 '12 at 16:02
    
@Dennis, good eyes! But that's just a typo. Thanks! – John Powel Oct 30 '12 at 16:03
    
When you logon with ssh, is it in /f$/logs/dev.log or is it in /_<homedir>_/f$/logs/dev.log? – BenjiWiebe Oct 30 '12 at 16:06
up vote 0 down vote accepted

Let me clarify the solution using wget:

Since I can use the URL to access the file, I simply use this line in my batch:

wget -q //myhost/f$/logs/dev.log -Y off

where "-q" means:

Turn on verbose output, with all the available data. The default output is verbose.

and "-Y" means:

Turn proxy on or off

This will download the file in the current directories and it solves my problem.

Reference: http://www.gnu.org/software/wget/manual/wget.html

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .