Re: Delete a folder name containing *

2014-08-21 Thread varun kumar
Make sure namenode is not in safe mode.


On Wed, Aug 20, 2014 at 6:53 AM, praveenesh kumar praveen...@gmail.com
wrote:

 Hi team

 I am in weird situation where I have  following HDFS sample folders

 /data/folder/
 /data/folder*
 /data/folder_day
 /data/folder_day/monday
 /data/folder/1
 /data/folder/2

 I want to delete /data/folder* without deleting its sub_folders. If I do
 hadoop fs -rmr /data/folder* it will delete everything which I want to
 avoid. I tried with escape character \ but HDFS FS shell is not taking it.
 Any hints/tricks ?


 Regards
 Praveenesh




-- 
Regards,
Varun Kumar.P


RE: Delete a folder name containing *

2014-08-21 Thread Liu, Yi A
Escape character is \, but please enclose with single quote

For example /foo/{123} should be '/foo/\{123\}'

Regards,
Yi Liu

From: varun kumar [mailto:varun@gmail.com]
Sent: Thursday, August 21, 2014 2:21 PM
To: user; praveen...@gmail.com
Subject: Re: Delete a folder name containing *

Make sure namenode is not in safe mode.

On Wed, Aug 20, 2014 at 6:53 AM, praveenesh kumar 
praveen...@gmail.commailto:praveen...@gmail.com wrote:
Hi team

I am in weird situation where I have  following HDFS sample folders

/data/folder/
/data/folder*
/data/folder_day
/data/folder_day/monday
/data/folder/1
/data/folder/2

I want to delete /data/folder* without deleting its sub_folders. If I do hadoop 
fs -rmr /data/folder* it will delete everything which I want to avoid. I tried 
with escape character \ but HDFS FS shell is not taking it. Any hints/tricks ?


Regards
Praveenesh



--
Regards,
Varun Kumar.P


Delete a folder name containing *

2014-08-20 Thread praveenesh kumar
Hi team

I am in weird situation where I have  following HDFS sample folders

/data/folder/
/data/folder*
/data/folder_day
/data/folder_day/monday
/data/folder/1
/data/folder/2

I want to delete /data/folder* without deleting its sub_folders. If I do
hadoop fs -rmr /data/folder* it will delete everything which I want to
avoid. I tried with escape character \ but HDFS FS shell is not taking it.
Any hints/tricks ?


Regards
Praveenesh


Re: Delete a folder name containing *

2014-08-20 Thread dileep kumar
Just Rename the folder.


On Wed, Aug 20, 2014 at 6:53 AM, praveenesh kumar praveen...@gmail.com
wrote:

 Hi team

 I am in weird situation where I have  following HDFS sample folders

 /data/folder/
 /data/folder*
 /data/folder_day
 /data/folder_day/monday
 /data/folder/1
 /data/folder/2

 I want to delete /data/folder* without deleting its sub_folders. If I do
 hadoop fs -rmr /data/folder* it will delete everything which I want to
 avoid. I tried with escape character \ but HDFS FS shell is not taking it.
 Any hints/tricks ?


 Regards
 Praveenesh



Re: Delete a folder name containing *

2014-08-20 Thread praveenesh kumar
With renaming - you would use the mv command hadoop fs -mv /data/folder*
/data/new_folder. Won't it move all the sub_dirs along with that ?


On Wed, Aug 20, 2014 at 12:00 PM, dileep kumar dileep...@gmail.com wrote:

 Just Rename the folder.


 On Wed, Aug 20, 2014 at 6:53 AM, praveenesh kumar praveen...@gmail.com
 wrote:

 Hi team

 I am in weird situation where I have  following HDFS sample folders

 /data/folder/
 /data/folder*
 /data/folder_day
 /data/folder_day/monday
 /data/folder/1
 /data/folder/2

 I want to delete /data/folder* without deleting its sub_folders. If I do
 hadoop fs -rmr /data/folder* it will delete everything which I want to
 avoid. I tried with escape character \ but HDFS FS shell is not taking it.
 Any hints/tricks ?


 Regards
 Praveenesh





Re: Delete a folder name containing *

2014-08-20 Thread Ritesh Kumar Singh
try putting the name in quotes


On Wed, Aug 20, 2014 at 4:35 PM, praveenesh kumar praveen...@gmail.com
wrote:

 With renaming - you would use the mv command hadoop fs -mv /data/folder*
 /data/new_folder. Won't it move all the sub_dirs along with that ?


 On Wed, Aug 20, 2014 at 12:00 PM, dileep kumar dileep...@gmail.com
 wrote:

 Just Rename the folder.


 On Wed, Aug 20, 2014 at 6:53 AM, praveenesh kumar praveen...@gmail.com
 wrote:

 Hi team

 I am in weird situation where I have  following HDFS sample folders

 /data/folder/
 /data/folder*
 /data/folder_day
 /data/folder_day/monday
 /data/folder/1
 /data/folder/2

 I want to delete /data/folder* without deleting its sub_folders. If I do
 hadoop fs -rmr /data/folder* it will delete everything which I want to
 avoid. I tried with escape character \ but HDFS FS shell is not taking it.
 Any hints/tricks ?


 Regards
 Praveenesh






Re: Delete a folder name containing *

2014-08-20 Thread dileep kumar
Try
hadoop fs -mv /data/folder*/*  new folder
Now you have only /data/folder*. and all data under /data/folder* will be
moved to new folder ,then delete /data/folder*.Not sure if it works. just
make a try.


On Wed, Aug 20, 2014 at 8:26 AM, Ritesh Kumar Singh 
riteshoneinamill...@gmail.com wrote:

 try putting the name in quotes


 On Wed, Aug 20, 2014 at 4:35 PM, praveenesh kumar praveen...@gmail.com
 wrote:

 With renaming - you would use the mv command hadoop fs -mv /data/folder*
 /data/new_folder. Won't it move all the sub_dirs along with that ?


 On Wed, Aug 20, 2014 at 12:00 PM, dileep kumar dileep...@gmail.com
 wrote:

 Just Rename the folder.


 On Wed, Aug 20, 2014 at 6:53 AM, praveenesh kumar praveen...@gmail.com
 wrote:

 Hi team

 I am in weird situation where I have  following HDFS sample folders

 /data/folder/
 /data/folder*
 /data/folder_day
 /data/folder_day/monday
 /data/folder/1
 /data/folder/2

 I want to delete /data/folder* without deleting its sub_folders. If I
 do hadoop fs -rmr /data/folder* it will delete everything which I want to
 avoid. I tried with escape character \ but HDFS FS shell is not taking it.
 Any hints/tricks ?


 Regards
 Praveenesh







Re: Delete a folder name containing *

2014-08-20 Thread praveenesh kumar
No, I have tried all usual things like single quotes, double quotes, escape
character.. but it is not working. I wonder what is escape char with Hadoop
FS utility.




On Wed, Aug 20, 2014 at 1:26 PM, Ritesh Kumar Singh 
riteshoneinamill...@gmail.com wrote:

 try putting the name in quotes


 On Wed, Aug 20, 2014 at 4:35 PM, praveenesh kumar praveen...@gmail.com
 wrote:

 With renaming - you would use the mv command hadoop fs -mv /data/folder*
 /data/new_folder. Won't it move all the sub_dirs along with that ?


 On Wed, Aug 20, 2014 at 12:00 PM, dileep kumar dileep...@gmail.com
 wrote:

 Just Rename the folder.


 On Wed, Aug 20, 2014 at 6:53 AM, praveenesh kumar praveen...@gmail.com
 wrote:

 Hi team

 I am in weird situation where I have  following HDFS sample folders

 /data/folder/
 /data/folder*
 /data/folder_day
 /data/folder_day/monday
 /data/folder/1
 /data/folder/2

 I want to delete /data/folder* without deleting its sub_folders. If I
 do hadoop fs -rmr /data/folder* it will delete everything which I want to
 avoid. I tried with escape character \ but HDFS FS shell is not taking it.
 Any hints/tricks ?


 Regards
 Praveenesh







Re: Delete a folder name containing *

2014-08-20 Thread Ritesh Kumar Singh
interesting ... although escape character is still the forward slash and
its proven to work with other special characters. Here's a link:
Deleting directory with special character
http://stackoverflow.com/questions/13529114/how-to-delete-a-directory-from-hadoop-cluster-which-is-having-comma-in-its-na




On Wed, Aug 20, 2014 at 6:22 PM, praveenesh kumar praveen...@gmail.com
wrote:

 No, I have tried all usual things like single quotes, double quotes,
 escape character.. but it is not working. I wonder what is escape char with
 Hadoop FS utility.




 On Wed, Aug 20, 2014 at 1:26 PM, Ritesh Kumar Singh 
 riteshoneinamill...@gmail.com wrote:

 try putting the name in quotes


 On Wed, Aug 20, 2014 at 4:35 PM, praveenesh kumar praveen...@gmail.com
 wrote:

 With renaming - you would use the mv command hadoop fs -mv
 /data/folder* /data/new_folder. Won't it move all the sub_dirs along with
 that ?


 On Wed, Aug 20, 2014 at 12:00 PM, dileep kumar dileep...@gmail.com
 wrote:

 Just Rename the folder.


 On Wed, Aug 20, 2014 at 6:53 AM, praveenesh kumar praveen...@gmail.com
  wrote:

 Hi team

 I am in weird situation where I have  following HDFS sample folders

 /data/folder/
 /data/folder*
 /data/folder_day
 /data/folder_day/monday
 /data/folder/1
 /data/folder/2

 I want to delete /data/folder* without deleting its sub_folders. If I
 do hadoop fs -rmr /data/folder* it will delete everything which I want to
 avoid. I tried with escape character \ but HDFS FS shell is not taking it.
 Any hints/tricks ?


 Regards
 Praveenesh








Re: Delete a folder name containing *

2014-08-20 Thread Ritesh Kumar Singh
use this:

hadoop fs -rmr /path-to-folder/folder\*

just tried it out :)


On Wed, Aug 20, 2014 at 7:07 PM, Ritesh Kumar Singh 
riteshoneinamill...@gmail.com wrote:

 interesting ... although escape character is still the forward slash and
 its proven to work with other special characters. Here's a link:
 Deleting directory with special character
 http://stackoverflow.com/questions/13529114/how-to-delete-a-directory-from-hadoop-cluster-which-is-having-comma-in-its-na




 On Wed, Aug 20, 2014 at 6:22 PM, praveenesh kumar praveen...@gmail.com
 wrote:

 No, I have tried all usual things like single quotes, double quotes,
 escape character.. but it is not working. I wonder what is escape char with
 Hadoop FS utility.




 On Wed, Aug 20, 2014 at 1:26 PM, Ritesh Kumar Singh 
 riteshoneinamill...@gmail.com wrote:

 try putting the name in quotes


 On Wed, Aug 20, 2014 at 4:35 PM, praveenesh kumar praveen...@gmail.com
 wrote:

 With renaming - you would use the mv command hadoop fs -mv
 /data/folder* /data/new_folder. Won't it move all the sub_dirs along with
 that ?


 On Wed, Aug 20, 2014 at 12:00 PM, dileep kumar dileep...@gmail.com
 wrote:

 Just Rename the folder.


 On Wed, Aug 20, 2014 at 6:53 AM, praveenesh kumar 
 praveen...@gmail.com wrote:

 Hi team

 I am in weird situation where I have  following HDFS sample folders

 /data/folder/
 /data/folder*
 /data/folder_day
 /data/folder_day/monday
 /data/folder/1
 /data/folder/2

 I want to delete /data/folder* without deleting its sub_folders. If I
 do hadoop fs -rmr /data/folder* it will delete everything which I want to
 avoid. I tried with escape character \ but HDFS FS shell is not taking 
 it.
 Any hints/tricks ?


 Regards
 Praveenesh









Re: Delete a folder name containing *

2014-08-20 Thread praveenesh kumar
Not working for me, strange :(


On Wed, Aug 20, 2014 at 3:00 PM, Ritesh Kumar Singh 
riteshoneinamill...@gmail.com wrote:

 use this:

 hadoop fs -rmr /path-to-folder/folder\*

 just tried it out :)


 On Wed, Aug 20, 2014 at 7:07 PM, Ritesh Kumar Singh 
 riteshoneinamill...@gmail.com wrote:

 interesting ... although escape character is still the forward slash and
 its proven to work with other special characters. Here's a link:
 Deleting directory with special character
 http://stackoverflow.com/questions/13529114/how-to-delete-a-directory-from-hadoop-cluster-which-is-having-comma-in-its-na




 On Wed, Aug 20, 2014 at 6:22 PM, praveenesh kumar praveen...@gmail.com
 wrote:

 No, I have tried all usual things like single quotes, double quotes,
 escape character.. but it is not working. I wonder what is escape char with
 Hadoop FS utility.




 On Wed, Aug 20, 2014 at 1:26 PM, Ritesh Kumar Singh 
 riteshoneinamill...@gmail.com wrote:

 try putting the name in quotes


 On Wed, Aug 20, 2014 at 4:35 PM, praveenesh kumar praveen...@gmail.com
  wrote:

 With renaming - you would use the mv command hadoop fs -mv
 /data/folder* /data/new_folder. Won't it move all the sub_dirs along with
 that ?


 On Wed, Aug 20, 2014 at 12:00 PM, dileep kumar dileep...@gmail.com
 wrote:

 Just Rename the folder.


 On Wed, Aug 20, 2014 at 6:53 AM, praveenesh kumar 
 praveen...@gmail.com wrote:

 Hi team

 I am in weird situation where I have  following HDFS sample folders

 /data/folder/
 /data/folder*
 /data/folder_day
 /data/folder_day/monday
 /data/folder/1
 /data/folder/2

 I want to delete /data/folder* without deleting its sub_folders. If
 I do hadoop fs -rmr /data/folder* it will delete everything which I 
 want to
 avoid. I tried with escape character \ but HDFS FS shell is not taking 
 it.
 Any hints/tricks ?


 Regards
 Praveenesh










Re: Delete a folder name containing *

2014-08-20 Thread hadoop hive
Move it to some tmp directory and delete parent directory.
On Aug 20, 2014 4:23 PM, praveenesh kumar praveen...@gmail.com wrote:

 Hi team

 I am in weird situation where I have  following HDFS sample folders

 /data/folder/
 /data/folder*
 /data/folder_day
 /data/folder_day/monday
 /data/folder/1
 /data/folder/2

 I want to delete /data/folder* without deleting its sub_folders. If I do
 hadoop fs -rmr /data/folder* it will delete everything which I want to
 avoid. I tried with escape character \ but HDFS FS shell is not taking it.
 Any hints/tricks ?


 Regards
 Praveenesh



Re: Delete a folder name containing *

2014-08-20 Thread Ritesh Kumar Singh
just to be sure, try this one too:

hadoop fs -rmr /data/folder\*


On Thu, Aug 21, 2014 at 1:36 AM, praveenesh kumar praveen...@gmail.com
wrote:

 Command used -

 1. hadoop fs -rmr /data/folder\*
 2. hadoop fs -rmr 'data/folder\*'
 3. hadoop fs -rmr /data/folder\*

 None of them gave any output. Hadoop version - 1.0.2


 On Wed, Aug 20, 2014 at 7:26 PM, Ritesh Kumar Singh 
 riteshoneinamill...@gmail.com wrote:

 what's the exact command you are using(with escape and quotes)?
 And what's the output after execution?


 On Wed, Aug 20, 2014 at 9:33 PM, hadoop hive hadooph...@gmail.com
 wrote:

 Move it to some tmp directory and delete parent directory.
 On Aug 20, 2014 4:23 PM, praveenesh kumar praveen...@gmail.com
 wrote:

 Hi team

 I am in weird situation where I have  following HDFS sample folders

 /data/folder/
 /data/folder*
 /data/folder_day
 /data/folder_day/monday
 /data/folder/1
 /data/folder/2

 I want to delete /data/folder* without deleting its sub_folders. If I
 do hadoop fs -rmr /data/folder* it will delete everything which I want to
 avoid. I tried with escape character \ but HDFS FS shell is not taking it.
 Any hints/tricks ?


 Regards
 Praveenesh