Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
04-06-2007, 02:36 PM
|
#1
|
Member
Registered: Mar 2007
Posts: 54
Rep:
|
How to copy/save a file from a Linux box to a local drive
Im trying to save or copy a log file or text file from Linux to my local drive.Cant quite find the command to do it.Thanks for any help.
1)I want to save it as a text file(testfile.txt)
2)Then save it to my local drive
$ zcat testfile.log.gz | awk '{print $12"\t"$13}' | less
|
|
|
04-06-2007, 02:39 PM
|
#2
|
Senior Member
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539
Rep:
|
not sure what you mean.. maybe: zcat testfile.log.gz > /path/to/output.txt
|
|
|
04-06-2007, 02:51 PM
|
#3
|
Member
Registered: Mar 2007
Posts: 54
Original Poster
Rep:
|
Im trying to do something like this:
$ zcat testfile.log.gz | awk '{print $12"\t"$13}' | less > c:\tmp\output.txt
where I can access output.txt on the local drive.But,im not sure that will work,in fact it does not work.
|
|
|
04-07-2007, 01:13 AM
|
#4
|
Member
Registered: Jul 2004
Posts: 164
Rep:
|
what's the "local drive"? c:\tmp\output.txt doesn't mean anything in linux--did you try nadroj's suggestion?
|
|
|
04-07-2007, 01:36 AM
|
#5
|
Member
Registered: Feb 2007
Distribution: Gentoo AMD64
Posts: 42
Rep:
|
First you will want to mount the Windows drive with the ability to write (which is kind of dangerous). The Windows drive will then have a mount point (for example /media/win_c ) and then you can treat the Windows drive like any ordinary directory.
|
|
|
04-08-2007, 11:12 AM
|
#6
|
Member
Registered: Mar 2007
Posts: 54
Original Poster
Rep:
|
Yes,I tried nadroj suggestion,that did not work. The local drive c:\tmp\output.txt.
I rsh to linux box,and there is a file there that I want on my local hard drive so I thought there should be an easy way just to get it on c:\tmp\output.txt.
|
|
|
04-08-2007, 11:21 PM
|
#7
|
Member
Registered: Jul 2004
Posts: 164
Rep:
|
|
|
|
04-09-2007, 03:50 PM
|
#8
|
Member
Registered: Mar 2007
Posts: 54
Original Poster
Rep:
|
Basically,all I want to do is to copy a file from a remote linux machine to my local machine.I will take a look at the link,hopefully,by some magic i will find the actual command that Im looking for to allow to do it. Thanks for the suggestions!!
|
|
|
04-09-2007, 04:13 PM
|
#9
|
Senior Member
Registered: Oct 2004
Posts: 1,272
Rep:
|
Quote:
Originally Posted by exl75
Basically,all I want to do is to copy a file from a remote linux machine to my local machine.I will take a look at the link,hopefully,by some magic i will find the actual command that Im looking for to allow to do it. Thanks for the suggestions!!
|
Ah, that makes much more sense! Your first few posts proper confused me, and most likely everyone else
Assuming sshd is running on the remote machine and you are using Windows on your local machine the easiest way would be to use pscp: http://www.chiark.greenend.org.uk/~s.../download.html
Documentation on how to use it: http://the.earth.li/~sgtatham/putty/...tml#pscp-usage
|
|
|
04-09-2007, 11:21 PM
|
#10
|
Member
Registered: Mar 2007
Posts: 54
Original Poster
Rep:
|
Ahh,thats it!! Thank you so much.I knew it was possible but was not sure how and where to get the info,but I thought I explained it well the first time,I guess not.Anyhow,I greatly appreciate it.Just what I needed.
|
|
|
04-10-2007, 07:20 AM
|
#11
|
LQ Guru
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Rep:
|
use SCP
Command Line option would be from the putty ssh suite. ( pscp.exe )
or winscp the GUI scp client for windows.. http://winscp.net/eng/download.php
|
|
|
04-10-2007, 12:52 PM
|
#12
|
Member
Registered: Mar 2007
Posts: 54
Original Poster
Rep:
|
Thanks a lot guys!! I will try that and see what happens.
|
|
|
All times are GMT -5. The time now is 05:53 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|