ls -1 *.jpeg | while read file do #timestamp=$(date -r $file +%k%M%S) #target=$(echo $file"_"$timestamp) target=echo "${file}_`date -r "${file}" +%H:%M:%S`" mv "$file" "$target" done