#!/bin/bash find . -type f -mtime -2 ! -mmin -1 ! -name '*.sh' -print0 | while IFS= read -r -d '' line do part1=$(dirname "$line") part2=$(basename "$line") mv $line $part1'/'$add$part2 done