Jan 01<span style="white-space:pre"> </span>This the log of this day.
Jan 01<span style="white-space:pre"> </span>This the log of this day.
Jan 01<span style="white-space:pre"> </span>This the log of this day.
Jan 01<span style="white-space:pre"> </span>This the log of this day.
Jan 01<span style="white-space:pre"> </span>This the log of this day.
Jan 01<span style="white-space:pre"> </span>This the log of this day.
Jan 01<span style="white-space:pre"> </span>This the log of this day.
Jan 01<span style="white-space:pre"> </span>This the log of this day.
Jan 01<span style="white-space:pre"> </span>This the log of this day.
Jan 01<span style="white-space:pre"> </span>This the log of this day.
Jan 02<span style="white-space:pre"> </span>This the log of this day.
Jan 02<span style="white-space:pre"> </span>This the log of this day.
Jan 02<span style="white-space:pre"> </span>This the log of this day.
Jan 02<span style="white-space:pre"> </span>This the log of this day.
Jan 02<span style="white-space:pre"> </span>This the log of this day.
Jan 02<span style="white-space:pre"> </span>This the log of this day.
Jan 02<span style="white-space:pre"> </span>This the log of this day.
Jan 02<span style="white-space:pre"> </span>This the log of this day.
Jan 02<span style="white-space:pre"> </span>This the log of this day.
Jan 02<span style="white-space:pre"> </span>This the log of this day.
Jan 02<span style="white-space:pre"> </span>This the log of this day.
Jan 03<span style="white-space:pre"> </span>This the log of this day.
Jan 03<span style="white-space:pre"> </span>This the log of this day.
Jan 03<span style="white-space:pre"> </span>This the log of this day.
Jan 03<span style="white-space:pre"> </span>This the log of this day.
Jan 03<span style="white-space:pre"> </span>This the log of this day.
Jan 03<span style="white-space:pre"> </span>This the log of this day.
Jan 03<span style="white-space:pre"> </span>This the log of this day.
Jan 03<span style="white-space:pre"> </span>This the log of this day.
Jan 03<span style="white-space:pre"> </span>This the log of this day.
Jan 03<span style="white-space:pre"> </span>This the log of this day.
Jan 03<span style="white-space:pre"> </span>This the log of this day.
csplit log '/Jan 01/' '/Jan 02/' '/Jan 03/'
执行以上命令后,生成文件如下:
./xx03
./xx01
./xx02
./xx00
编写脚本,将以上无意义的文件名通过提取文件中第一行的日期进行重命名:
mv $1 `head -n1 $1 | awk '{print $1 "-" $2}'`
在当前目录执行脚本:
find . -name "xx*" -exec ./rename.sh {} \;
则以上xx文件都会被改名为有意义的文件名。