#! /bin/sh idx=1 for f; do ln -s "$f" $(printf "%05d" "$idx").jpg idx=$((idx + 1)) done # $ script.sh image16-06-17*.jpg