clear #Example: rename filename from article to phone: #from=article #to=phone from=article to=phone cmd='find * -type f ' echo $cmd list=$( eval "$cmd" | grep $from ) for item in $list;do test -f $item && ( file1=$( echo $item | sed "s/$from/$to/g" ) echo $file1 mv $item $file1 test -f $file1 ) done