Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
S3 Mass Rename Files
# move all txt to tsv in directory
for file in $(aws s3 ls s3://bucket-name/path/ | awk '{print $4}'); do
if [[ $file == *.txt ]]; then
filename="${f%.*}"
aws s3 mv s3://bucket-name/path/$file s3://bucket-name/path/$filename.tsv
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment