shell修改文件名问题

shell修改文件名问题

我的目录里面有很多*.a.log日志,我现在想转化为*.a怎么转化呢.
要是变成*.log呢.      
FYI:
复制内容到剪贴板
代码:
[color=blue]-(dearvoid@LinuxEden:tty3)-(~/tmp/xx)-
[765 0][/color] [color=red]; l
[/color]total 0
-rw-r--r-- 1 root root 0 2007-03-02 16:53 1.a.log
-rw-r--r-- 1 root root 0 2007-03-02 16:53 2.a.log
[color=blue]-(dearvoid@LinuxEden:tty3)-(~/tmp/xx)-
[765 0][/color] [color=red]; for i in *.a.log; do mv $i ${i%.a.log}.a; done
[/color][color=blue]-(dearvoid@LinuxEden:tty3)-(~/tmp/xx)-
[765 0][/color] [color=red]; l
[/color]total 0
-rw-r--r-- 1 root root 0 2007-03-02 16:53 1.a
-rw-r--r-- 1 root root 0 2007-03-02 16:53 2.a
[color=blue]-(dearvoid@LinuxEden:tty3)-(~/tmp/xx)-
[765 0][/color] [color=red]; o
[/color]
      
基本功要会
但高级工具用得也很爽
不知道rename这程序到底在哪些发行版上才有?

在ubuntu上
rename是prename的链接
由perl包提供

[php]
[1 No.2037 huan@huan ~/tmp]$ readlink `which rename`
/etc/alternatives/rename

[0 No.2038 huan@huan ~/tmp]$ readlink $(!!)
readlink $(readlink `which rename`)
/usr/bin/prename

[0 No.2039 huan@huan ~/tmp]$ dpkg -S $(!!)
dpkg -S $(readlink $(readlink `which rename`))
perl: /usr/bin/prename

[0 No.2040 huan@huan ~/tmp]$

[/php]