Renaming Linux Files is very simple. Common commands are mv commands and rename commands. The following describes the usage of these two commands. For details about the nodules, refer to the manual.
1. mv
MV fromfile tofile
For example, if the.txt file is named B .txt, it can be mv a.txt B .txt.
MV can only rename one file at a time, and it is a mobile command. If tofile already exists, it will directly overwrite the original file, resulting in file loss. Of course, there are options to prompt for existing files, but I mean, that option is really not commonly used. Based on these two considerations, let's take a look at rename.
2. Rename
Rename frompart topart filename or rename's/frompart/topart/'filename
If the.txt file is named B .txt, it can be rename 'A' B 'a.txt (this is the case if you haven't tried it and read what others have said on the Internet .) It can also be: Rename's/^ a/B/'a.txt
On some systems, you can use the previous sentence. On some systems, you can use the following sentence. There are two differences: one is C and the other is Perl. Obviously, the following is the regular expression. Which method can be used? Man rename is used to view the version on the last line of the manual page. Since the rename version of my system is Perl, I can only use this method later.
What makes rename powerful is that you can use *,? . When using music videos, you can only write scripts and solve them in a loop.
For more information about the two commands, see the online manual.