#!/bin/bash
index=1
for i in `ls -U *.mp4`; do
new=$(printf "%02d.${i}" ${index})
mv ${i} ${new}
let index=index+1
done
-t
按最后修改时间
-U
按创建时间
$ man ls
-t Sort by time modified (most recently modified first) before sorting the operands by lexicographical order.
-U Use time of file creation, instead of last modification for sorting (-t) or long output (-l).
网友评论