First, let's take a look at the MV command. In man mV, we can see that the introduction to the MV command is as follows:
MV-move (rename) files
You can see that the MV command does have the rename function, but in actual applications, it can only rename a single file. The command is as follows:
MV [path/] oldfilename [path/] newfilename
The MV command can only rename a single file. This is the fundamental difference between the MV command and the RENAME Command in renaming.
The RENAME command describes man Rename as follows:
Name
Rename-rename files
Synopsis
Rename from to file ....
Description
Rename will rename the specified files by replacing the first occurrence of from in their name by.
For example, 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.
It can be seen that the RENAME Command is dedicated to file rename. According to the following example, rename can be used to rename a single file in batches. At the same time, it is worth noting that the RENAME command contains three parameters instead of the two parameters that many people think.
In the above example, the use of batch Rename for two types of files is given. In fact, rename is used in combination with wildcards, and its function is more powerful than that shown in the above example. Basic wildcards include the following:
? Can replace a single character
* Replace multiple characters
[Charset] can replace any single character in the charset set