命令行:操作文件名; grep?

Command Line: manipulating file names; grep?

我目前有一个基于日期的文件目录,格式为 <em>mmddyy</em>:


    nxd060815a.html
    nxd060915a.html
    nxd061015a.html

并想将文件名格式更改为 <em>yyyy-mm-dd</em>:


    nxd2015-06-08a.html
    nxd2015-06-09a.html
    nxd2015-06-10a.html

我如何从命令行执行此操作?

感谢任何帮助。

ls | awk '{ system("mv " [=10=] " " substr([=10=],1,3) "20" substr([=10=],8,2) "-" substr([=10=],4,2) "-" substr([=10=],6,2) substr([=10=],10,6))}'

运行 以上来自文件所在的目录。您应该能够弄清楚发生了什么,所以没有其他评论。