You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hadoop.apache.org by Tomislav Novosel <to...@gmail.com> on 2018/11/19 10:13:16 UTC

HDFS files deletion

Hi all,

I'm trying to delete files from HDFS using this command:

hdfs dfs -ls /projects/BX77004/tmp | grep -e
REM_AV1876B_ADL_12_20180720143210 | awk '{print $8}' | xargs hdfs dfs -rm

I want to delete all files that begin with
REM_AV1876B_ADL_12_20180720143210, but response is:

rm:
`/projects/BX77004/tmp/REM_AV1876B_ADL_12_20180720143210_ProjSpecREC_10Hz_1[1].parquet':
No such file or directory
rm:
`/projects/BX77004/tmp/REM_AV1876B_ADL_12_20180720143210_ProjSpecREC_10Hz_1[2].parquet':
No such file or directory
rm:
`/projects/BX77004/tmp/REM_AV1876B_ADL_12_20180720143210_ProjSpecREC_10Hz_1[3].parquet':
No such file or directory
rm:
`/projects/BX77004/tmp/REM_AV1876B_ADL_12_20180720143210_ProjSpecREC_10Hz_1[4].parquet':
No such file or directory

When I remove [] (brackets) from file name, all goes right, files are
deleted. How can I escape those characters, or is there any other way to
delete that files.

Please help.

BR,
Tomislav