红联Linux门户
Linux帮助

修改文件名的命名

发布时间:2010-09-24 17:50:58来源:红联作者:zhuxubai
我有一个文件名字为test.php,我现在想修改成index.php

可是用
rename 'test' 'index' '*.php'
不行,不知道怎么搞,谢谢。
文章评论

共有 1 条评论

  1. acrofox 于 2010-09-25 06:22:54发表:

    用 mv 就可以了:
    mv test.php index.php
    用 rename 适合批量改名,有两个不同的 rename,用法不一样。不管是哪个 rename,最后那个 *.php 都不应该加引号。
    如果用 rename,取决于你系统所安装的 rename,使用下面两条命令中的某一条:
    rename test index *.php

    rename '/s/test/index/' *.php