#!/bin/bashlet i=1 # define an incremental variablepath=./video # add your file path herecd ${path}mkdir bak # make a backup directoryfor loop in `ls -1 | tr ' ' '#'`domv "`echo $loop | sed 's/#/ /g' `" "`echo $loop |sed 's/#//g' `" 2> /dev/nulldonefor file in *.mp4 # *.jpg means all jpg files in current directorydocp ${file} baknum=`echo $i | awk '{printf("%02d",$0)}'`;mv ${file} shenyf-${num}.mp4# echo "${file} renamed as ${num}.mp4"let i=i+1done
