Linux Rename command usage 1th/2 page _unix Linux

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.