Re: 更改副檔名? - BBS

Table of Contents

※ 引述《[email protected] (胖仔)》之銘言:
: 請問如何一次更改大量檔案的副檔名,由大寫轉成小寫呢?
: 謝謝!!
這一段是從vim tips裡看來的
如果有vim,又不會shell script的話可以試試看

文件更名 *rename-files*

假如我有一個目錄,裡面有如下的文件(目錄是隨機選取的):

buffer.c
charset.c
digraph.c
...

現在我希望把 *.c 更名為 *.bla。我可以這樣做:

$ vim
:r! ls *.c
:%s/\(.*\).c/mv & \1.bla
:w !sh
:q!

--

All Comments