rename在man中的解释为:

NAME
rename - rename files SYNOPSIS
rename [options] expression replacement file... DESCRIPTION
rename will rename the specified files by replacing the first occurrence of expression in their name by replacement. OPTIONS
-v, --verbose
Give visual feedback which files where renamed, if any. -V, --version
Display version information and exit. -s, --symlink
Peform rename on symlink target -h, --help
Display help text and exit. EXAMPLES
Given the files foo1, ..., foo9, foo10, ..., foo278, the commands rename foo foo0 foo?
rename foo foo0 foo?? will turn them into foo001, ..., foo009, foo010, ..., foo278. And rename .htm .html *.htm will fix the extension of your html files. WARNING
The renaming has no safeguards. If the user has permission to rewrite file names, the command will perform the action without any questions. For example,
the result can be quite drastic when the command is run as root in the /lib directory. Always make a backup before running the command, unless you truly
know what you are doing. SEE ALSO
mmv(1), mv(1)

其参数为三个,而不是两个

mv指令也可以更改文件名,但是只能一个一个更改

rename命令提供了批量更改的渠道

用法如下:

比如一个文件夹下有如下文件

20190328. 20190329. 20190330. 20190331. 20190401. 20190402. 20190403. 20190404. 20190405. 20190406. 20190407. 20190408. 20190409.

我要把每个文件后面的“.”置换成“.txt”则只需执行如下命令

rename . .txt *.

这样就 okl

“*”是通配符,还有“?”是代表一个字符

希望对大家有所帮助

以上

linux_rename命令用法的更多相关文章

  1. systemctl命令用法详解

    systemctl命令用法详解系统环境:Fedora 16binpath:/bin/systemctlpackage:systemd-units systemctl enable httpd.serv ...

  2. cpio命令用法

    [转自]流浪妖精のSKY    http://www.cnitblog.com/flutist1225/articles/18974.html cpio命令用法 cpio命令     利用cpio 可 ...

  3. shutdown命令用法

    首先我们先创建一个txt文件,添加shutdown -r -f -t 0 ,文件点击另存为,选择所有类型,保存格式为“重启.bat”文件. 说明:shutdown命令用法: /r         关闭 ...

  4. linux中comm命令用法

    linux系统中comm命令用法详解 linux系统下的comm命令是一个非常实用的文件对比命令. comm命令功能:   选择或拒绝两个已排序的文件的公共的行. comm命令语法:comm [-12 ...

  5. Ubuntu kill命令用法详解

    转自:Ubuntu kill命令用法详解 1. kill   作用:根据进程号杀死进程   用法: kill [信号代码] 进程ID   root@fcola:/# ps -ef | grep sen ...

  6. install 命令用法详解

    install 命令用法详解 http://man.linuxde.net/install install命令的作用是安装或升级软件或备份数据,它的使用权限是所有用户.install命令和cp命令类似 ...

  7. which、whereis、locate、find 命令用法

    which.whereis.locate.find 命令用法   大部分转自http://312788172.iteye.com/blog/730280,有修改 我们经常在linux要查找某个文件,但 ...

  8. sed命令用法详解

    sed命令用法 sed是一种流编辑器,它是文本处理中非常有用的工具,能够完美的配合正则表达式使用,功能不同凡响.处理时,把当前处理的行存储在临时缓冲区中,称为『模式空间』(pattern space) ...

  9. linux的strace命令用法

    strace命令用法 调用:strace [ -dffhiqrtttTvxx ] [ -acolumn ] [ -eexpr ] …[ -ofile ] [ -ppid ] … [ -sstrsize ...

随机推荐

  1. JAVA_HOME环境配置

    JAVA_HOME指明JDK安装路径,就是刚才安装时所选择的路径D:\java\jdk1.5.0_08 Path使得系统可以在任何路径下识别java命令,设为:%JAVA_HOME%\bin;%JAV ...

  2. 读吴恩达算-EM算法笔记

    最近感觉对EM算法有一点遗忘,在表述的时候,还是有一点说不清,于是重新去看了这篇<CS229 Lecture notes>笔记. 于是有了这篇小札. 关于Jensen's inequali ...

  3. 20.2.翻译系列:EF 6中基于代码的数据库迁移技术【EF 6 Code-First系列】

    原文链接:https://www.entityframeworktutorial.net/code-first/code-based-migration-in-code-first.aspx EF 6 ...

  4. linux环境快速安装python3

    之前在linux上安装python3的时候,为了让不影响linux环境原有的python2的环境,选择的方法都是下载对应的linux环境的python包,不过 这里需要注意的是,不要更改linux默认 ...

  5. ASP.NET CORE下运行CMD命令

    ASP.NET CORE下运行CMD命令,用以前的ASP.NET 的命令System.Diagnostics.Process.Start("notepad");这样是可以运行出记事 ...

  6. CentOS 7下PXE+Kickstart无人值守安装操作系统

    1.简介 1.1. 什么是PXE PXE(Pre-boot Execution Environment,预启动执行环境)是由Intel公司开发的最新技术,工作于Client/Server的网络模式,支 ...

  7. MATLAB 显示输出数据的三种方式

    MATLAB 显示输出数据的三种方式 ,转载 https://blog.csdn.net/qq_35318838/article/details/78780412 1.改变数据格式 当数据重复再命令行 ...

  8. 框架源码系列十二:Mybatis源码之手写Mybatis

    一.需求分析 1.Mybatis是什么? 一个半自动化的orm框架(Object Relation Mapping). 2.Mybatis完成什么工作? 在面向对象编程中,我们操作的都是对象,Myba ...

  9. java web service 写入图片到web/img/

    获取本类service路径,然后字符串截取和拼接 String classpath= this.getClass().getResource("/").getPath(); Str ...

  10. 【QT】QT更改构建目录

    菜单“工具”-“选项”. Qt Creator怎样更改默认构建目录_百度经验 https://jingyan.baidu.com/article/6181c3e0b9d170152ef153af.ht ...