简体   繁体   中英

Hadoop - How to remove files by name

Is there a command in hadoop to remove files starting with ab ? The files can occur in sub-directories and the operation should be recursive. Something similar to the below :

Hadoop fs -rmr /mydir/ab*

You can try like below,

hadoop fs -rmr "/mydir/ab*"

You need to use double quotes for the path which contains wildcard.

References:

Hadoop HDFS copy with wildcards?

Hadoop fs -rm with regular expression

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM