First of all, the MV command, in the man MV we can see the MV command of the introduction is such:
Mv-move (rename) files
You can see that the MV command does have a renaming function, but in practice it can only rename a single file, and the command is as follows:
MV [Path/]oldfilename [Path/]newfilename
The MV command can only rename a single file, which is the fundamental difference between the MV command and the Rename command in terms of renaming.
Again, the Rename command, in man rename's description is as follows:
NAME
Rename-rename files
Synopsis
Rename from to file ....
DESCRIPTION
Rename would rename the specified files by replacing the ' the ' in occurrence of ' from ' to.
For example, given the files foo1, ..., foo9, Foo10, ..., foo278, the commands
Rename foo foo0 foo?
Rename foo foo0 foo??
Would turn them into foo001, ..., foo009, foo010, ..., foo278.
and
Rename. htm. html *.htm
Would fix the extension of your HTML files.
You can see that the Rename command is dedicated to file renaming, and as you can see from the example below, rename can also rename a batch file in addition to renaming a single file. At the same time, it is worth noting that the Rename command is a 2 parameter with 3 parameters rather than many people think.
In the example above, the use of the two file batch renames is given, and in fact, the rename is more powerful than the example above, when used in combination with wildcard characters. The basic wildcard characters are as follows:
? Can replace a single character
* Can replace multiple characters
[CharSet] can override any single character in the CharSet set
Current 1/2 page
12 Next read the full text