bash - Is there a way to add a time stamp in all file names in a folder? -


i'm using aws cli in linux ec2 instance move files folder s3 bucket. files moved have current time or better, the file created @ date in name. possible? command:

aws s3 mv /home/wowza/content/ s3://bucket/folder/ --recursive

it doesn't have aws cli command. can commands rename files in folder , run aws s3 command.

you rename files in #bash (using for) , upload aws s3.

for f in test/*; timestamp=$(date +%s); filename=${f%.*}; extension=${f##*.}; newname="$filename-$timestamp.$extension"; mv $f $newname; done 

Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -