On windows cgywinportable, run the linux Command to modify file names in batches ., Windows batch rename

Source: Internet
Author: User

On windows cgywinportable, run the linux Command to modify file names in batches ., Windows batch rename

On windows cgywinportable, run the linux Command to modify file names in batches.

Instance: Add. SQL to all file names in the current directory

Find./-type f-exec mv {} '{}. SQL ';


Linux Command for batch replacement of folder names, file names, and file content

1. flexible use of for, replacement of Characters in the file name, plus date, etc.

Use the following statement to test
For I in * aa *; do NN =$ (echo $ I | sed's/aa/bb/'); echo "$ NN"; done

For the sake of insurance, only copy
For I in * aa *; do NN =$ (echo $ I | sed's/aa/bb/'); cp "$ I" "$ NN"; done

This is a RENAME. Use it with caution.
For I in * aa *; do NN =$ (echo $ I | sed's/aa/bb/'); mv "$ I" "$ NN"; done

2. Simple rename
Test with-n switch

Rename-n's/aa/bb /'*

If the test is correct, remove-n and rename it.
Rename's/aa/bb /'*

In Linux, how does one compile the command to change the file Owner attribute by batch conditions?

Find/a-user root-exec chown oracle: oracle {}\;

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.