2012-09-19 85 views
0

我有幾個文件在Linux中:重命名一批文件在bash

_foo_1.php 
_foo_2.php 
_foo_3.php 

我想他們都從_foo重命名爲_bar,保存文件名的其餘部分。

我已經試過了,但它並沒有任何重命名:

rename 's/_foo/_bar/' *.php 

回答

3

您正在使用的語法是Debian重命名。 Red Hat重命名使用完全不同的語法。

rename _foo _bar _foo*.php 
+0

就是這樣。謝謝。 – chovy