#!/bin/sh datetime=$(date "+%Y%m%d%H%M%S") dumps=$(find /data/heapdump -name '*.hprof') for dump in $dumps do mv $dump `echo "$dump.$datetime"` done