s3 rename in batch

# rename.sh this example move all files in folder1 up to root directory, you can modify bucket name and regex to rename the files

for f in $(aws s3 ls –recursive s3://bucket1/folder1/ | awk -F’ ‘ ‘{print $4}’);

  do aws s3 mv s3://bucket1/$f s3://bucket1/${f/.*\//}

done

This entry was posted in hadoop, linux. Bookmark the permalink.

Leave a comment