You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hadoop.apache.org by Chengi Liu <ch...@gmail.com> on 2013/08/29 22:35:35 UTC

copy files from hdfs to local fs

Ok,

  A very stupid question...

I have a large file in

    /user/input/foo.txt

I want to copy first 100 lines from this location to local filesystem...

And the data is very sensitive so i am bit hesistant to experiment.

What is the right way to copy sample data from hdfs to local fs.

RE: copy files from hdfs to local fs

Posted by java8964 java8964 <ja...@hotmail.com>.
What's wrong by using old Unix pipe?
hadoop fs -cat /user/input/foo.txt | head -100 > local_file

Date: Thu, 29 Aug 2013 13:50:37 -0700
Subject: Re: copy files from hdfs to local fs
From: chengi.liu.86@gmail.com
To: user@hadoop.apache.org

tail will work as well.. ??? but i want to extract just (say) n lines out of this file?

On Thu, Aug 29, 2013 at 1:43 PM, Kim Chew <kc...@gmail.com> wrote:

hadoop fs -copyToLocal
or
hadoop fs -get

It copies the whole file and won't be able just to copy part of the file, what is interesting is there is a "tail" command but no "head".



Kim


On Thu, Aug 29, 2013 at 1:35 PM, Chengi Liu <ch...@gmail.com> wrote:


Ok,
  A very stupid question...
I have a large file in 


    /user/input/foo.txt
I want to copy first 100 lines from this location to local filesystem...

And the data is very sensitive so i am bit hesistant to experiment.
What is the right way to copy sample data from hdfs to local fs.




 		 	   		  

RE: copy files from hdfs to local fs

Posted by java8964 java8964 <ja...@hotmail.com>.
What's wrong by using old Unix pipe?
hadoop fs -cat /user/input/foo.txt | head -100 > local_file

Date: Thu, 29 Aug 2013 13:50:37 -0700
Subject: Re: copy files from hdfs to local fs
From: chengi.liu.86@gmail.com
To: user@hadoop.apache.org

tail will work as well.. ??? but i want to extract just (say) n lines out of this file?

On Thu, Aug 29, 2013 at 1:43 PM, Kim Chew <kc...@gmail.com> wrote:

hadoop fs -copyToLocal
or
hadoop fs -get

It copies the whole file and won't be able just to copy part of the file, what is interesting is there is a "tail" command but no "head".



Kim


On Thu, Aug 29, 2013 at 1:35 PM, Chengi Liu <ch...@gmail.com> wrote:


Ok,
  A very stupid question...
I have a large file in 


    /user/input/foo.txt
I want to copy first 100 lines from this location to local filesystem...

And the data is very sensitive so i am bit hesistant to experiment.
What is the right way to copy sample data from hdfs to local fs.




 		 	   		  

RE: copy files from hdfs to local fs

Posted by java8964 java8964 <ja...@hotmail.com>.
What's wrong by using old Unix pipe?
hadoop fs -cat /user/input/foo.txt | head -100 > local_file

Date: Thu, 29 Aug 2013 13:50:37 -0700
Subject: Re: copy files from hdfs to local fs
From: chengi.liu.86@gmail.com
To: user@hadoop.apache.org

tail will work as well.. ??? but i want to extract just (say) n lines out of this file?

On Thu, Aug 29, 2013 at 1:43 PM, Kim Chew <kc...@gmail.com> wrote:

hadoop fs -copyToLocal
or
hadoop fs -get

It copies the whole file and won't be able just to copy part of the file, what is interesting is there is a "tail" command but no "head".



Kim


On Thu, Aug 29, 2013 at 1:35 PM, Chengi Liu <ch...@gmail.com> wrote:


Ok,
  A very stupid question...
I have a large file in 


    /user/input/foo.txt
I want to copy first 100 lines from this location to local filesystem...

And the data is very sensitive so i am bit hesistant to experiment.
What is the right way to copy sample data from hdfs to local fs.




 		 	   		  

RE: copy files from hdfs to local fs

Posted by java8964 java8964 <ja...@hotmail.com>.
What's wrong by using old Unix pipe?
hadoop fs -cat /user/input/foo.txt | head -100 > local_file

Date: Thu, 29 Aug 2013 13:50:37 -0700
Subject: Re: copy files from hdfs to local fs
From: chengi.liu.86@gmail.com
To: user@hadoop.apache.org

tail will work as well.. ??? but i want to extract just (say) n lines out of this file?

On Thu, Aug 29, 2013 at 1:43 PM, Kim Chew <kc...@gmail.com> wrote:

hadoop fs -copyToLocal
or
hadoop fs -get

It copies the whole file and won't be able just to copy part of the file, what is interesting is there is a "tail" command but no "head".



Kim


On Thu, Aug 29, 2013 at 1:35 PM, Chengi Liu <ch...@gmail.com> wrote:


Ok,
  A very stupid question...
I have a large file in 


    /user/input/foo.txt
I want to copy first 100 lines from this location to local filesystem...

And the data is very sensitive so i am bit hesistant to experiment.
What is the right way to copy sample data from hdfs to local fs.




 		 	   		  

Re: copy files from hdfs to local fs

Posted by Chengi Liu <ch...@gmail.com>.
tail will work as well.. ??? but i want to extract just (say) n lines out
of this file?


On Thu, Aug 29, 2013 at 1:43 PM, Kim Chew <kc...@gmail.com> wrote:

> hadoop fs -copyToLocal
> or
> hadoop fs -get
>
> It copies the whole file and won't be able just to copy part of the file,
> what is interesting is there is a "tail" command but no "head".
>
> Kim
>
>
> On Thu, Aug 29, 2013 at 1:35 PM, Chengi Liu <ch...@gmail.com>wrote:
>
>> Ok,
>>
>>   A very stupid question...
>>
>> I have a large file in
>>
>>     /user/input/foo.txt
>>
>> I want to copy first 100 lines from this location to local filesystem...
>>
>> And the data is very sensitive so i am bit hesistant to experiment.
>>
>> What is the right way to copy sample data from hdfs to local fs.
>>
>>
>

Re: copy files from hdfs to local fs

Posted by Chengi Liu <ch...@gmail.com>.
tail will work as well.. ??? but i want to extract just (say) n lines out
of this file?


On Thu, Aug 29, 2013 at 1:43 PM, Kim Chew <kc...@gmail.com> wrote:

> hadoop fs -copyToLocal
> or
> hadoop fs -get
>
> It copies the whole file and won't be able just to copy part of the file,
> what is interesting is there is a "tail" command but no "head".
>
> Kim
>
>
> On Thu, Aug 29, 2013 at 1:35 PM, Chengi Liu <ch...@gmail.com>wrote:
>
>> Ok,
>>
>>   A very stupid question...
>>
>> I have a large file in
>>
>>     /user/input/foo.txt
>>
>> I want to copy first 100 lines from this location to local filesystem...
>>
>> And the data is very sensitive so i am bit hesistant to experiment.
>>
>> What is the right way to copy sample data from hdfs to local fs.
>>
>>
>

Re: copy files from hdfs to local fs

Posted by Chengi Liu <ch...@gmail.com>.
tail will work as well.. ??? but i want to extract just (say) n lines out
of this file?


On Thu, Aug 29, 2013 at 1:43 PM, Kim Chew <kc...@gmail.com> wrote:

> hadoop fs -copyToLocal
> or
> hadoop fs -get
>
> It copies the whole file and won't be able just to copy part of the file,
> what is interesting is there is a "tail" command but no "head".
>
> Kim
>
>
> On Thu, Aug 29, 2013 at 1:35 PM, Chengi Liu <ch...@gmail.com>wrote:
>
>> Ok,
>>
>>   A very stupid question...
>>
>> I have a large file in
>>
>>     /user/input/foo.txt
>>
>> I want to copy first 100 lines from this location to local filesystem...
>>
>> And the data is very sensitive so i am bit hesistant to experiment.
>>
>> What is the right way to copy sample data from hdfs to local fs.
>>
>>
>

Re: copy files from hdfs to local fs

Posted by Chengi Liu <ch...@gmail.com>.
tail will work as well.. ??? but i want to extract just (say) n lines out
of this file?


On Thu, Aug 29, 2013 at 1:43 PM, Kim Chew <kc...@gmail.com> wrote:

> hadoop fs -copyToLocal
> or
> hadoop fs -get
>
> It copies the whole file and won't be able just to copy part of the file,
> what is interesting is there is a "tail" command but no "head".
>
> Kim
>
>
> On Thu, Aug 29, 2013 at 1:35 PM, Chengi Liu <ch...@gmail.com>wrote:
>
>> Ok,
>>
>>   A very stupid question...
>>
>> I have a large file in
>>
>>     /user/input/foo.txt
>>
>> I want to copy first 100 lines from this location to local filesystem...
>>
>> And the data is very sensitive so i am bit hesistant to experiment.
>>
>> What is the right way to copy sample data from hdfs to local fs.
>>
>>
>

Re: copy files from hdfs to local fs

Posted by Kim Chew <kc...@gmail.com>.
hadoop fs -copyToLocal
or
hadoop fs -get

It copies the whole file and won't be able just to copy part of the file,
what is interesting is there is a "tail" command but no "head".

Kim


On Thu, Aug 29, 2013 at 1:35 PM, Chengi Liu <ch...@gmail.com> wrote:

> Ok,
>
>   A very stupid question...
>
> I have a large file in
>
>     /user/input/foo.txt
>
> I want to copy first 100 lines from this location to local filesystem...
>
> And the data is very sensitive so i am bit hesistant to experiment.
>
> What is the right way to copy sample data from hdfs to local fs.
>
>

Re: copy files from hdfs to local fs

Posted by Kim Chew <kc...@gmail.com>.
hadoop fs -copyToLocal
or
hadoop fs -get

It copies the whole file and won't be able just to copy part of the file,
what is interesting is there is a "tail" command but no "head".

Kim


On Thu, Aug 29, 2013 at 1:35 PM, Chengi Liu <ch...@gmail.com> wrote:

> Ok,
>
>   A very stupid question...
>
> I have a large file in
>
>     /user/input/foo.txt
>
> I want to copy first 100 lines from this location to local filesystem...
>
> And the data is very sensitive so i am bit hesistant to experiment.
>
> What is the right way to copy sample data from hdfs to local fs.
>
>

Re: copy files from hdfs to local fs

Posted by Kim Chew <kc...@gmail.com>.
hadoop fs -copyToLocal
or
hadoop fs -get

It copies the whole file and won't be able just to copy part of the file,
what is interesting is there is a "tail" command but no "head".

Kim


On Thu, Aug 29, 2013 at 1:35 PM, Chengi Liu <ch...@gmail.com> wrote:

> Ok,
>
>   A very stupid question...
>
> I have a large file in
>
>     /user/input/foo.txt
>
> I want to copy first 100 lines from this location to local filesystem...
>
> And the data is very sensitive so i am bit hesistant to experiment.
>
> What is the right way to copy sample data from hdfs to local fs.
>
>

Re: copy files from hdfs to local fs

Posted by Kim Chew <kc...@gmail.com>.
hadoop fs -copyToLocal
or
hadoop fs -get

It copies the whole file and won't be able just to copy part of the file,
what is interesting is there is a "tail" command but no "head".

Kim


On Thu, Aug 29, 2013 at 1:35 PM, Chengi Liu <ch...@gmail.com> wrote:

> Ok,
>
>   A very stupid question...
>
> I have a large file in
>
>     /user/input/foo.txt
>
> I want to copy first 100 lines from this location to local filesystem...
>
> And the data is very sensitive so i am bit hesistant to experiment.
>
> What is the right way to copy sample data from hdfs to local fs.
>
>