I want to copy some 1500 files from one folder on cluster to another folder but meanwhile i want to append a suffix or prefix to the name of file. If this is done for just a one file then we could simply do
hdfs dfs -cp /sourcePath/fileName /destinationPath/fileName-new
but as there are 1500 files i want to do this in something like
hdfs dfs -cp /sourcePath/* /destinationPath/*-new
But I can't use * as file name placeholder. However if there was some way to get all the file names of a folder present on cluster we can iterate over then and use command as in
nohup bash -c 'for i in AllFileNames; do hdfs dfs -cp /sourceDir/$i /destinationDir/$i-new do ; done' &
So what should be the way out from this problem ?