In this article , stay linux Next use shell Examples of batch renaming files , Friends in need can refer to it .

stay linux in , Rename filename , Need to use mv command .
If you need to batch rename a batch of files , You need to write bash Script or command line .

for example , To put aaaaaaaaaaaaa.jpg Rename it to aaaaaaaaaaaaa_MED.jpg

command :

Code example :
for i in *.jpg;do mv "$i" "${i%.jpg}_MED.jpg" ;done

Empathy aaaaaaaaaaaaa_MED.jpg Rename it to aaaaaaaaaaaaa_LRG.jpg Methods :

Code example :
for i in *.jpg;do mv "$i" "${i%_MED.jpg}_LRG.jpg" ;done

Easy , Friends in need , You can refer to it shell Articles in programming , Study hard .


Linux Command line bash More articles about batch renaming files

  1. Linux command - mv: Move or rename files

    Command format cp [OPTION]... [-T] SOURCE DEST cp [OPTION]... SOURCE... DIRECTORY cp [OPTION]... -t DIRECTORY ...

  2. Linux Batch rename files

    There are five ways to achieve Linux Batch rename files Linux Batch renaming refers to the uniform renaming of some specific files , To change the name of the original batch of files , Here are five ways to achieve . Linux Batch renaming of files involves changing a letter . Change ...

  3. cmd - Batch rename files

    I believe you have more or less encountered similar situations : I downloaded a lot of pictures from the Internet ( Or other documents ), The names of these pictures are often a jumble of alphanumeric combinations , What should we do if we want to change the names of dozens or hundreds of pictures at one time ? There are two ways , ...

  4. [ turn ]【Windows Tips 】 Batch rename files

    notes : If the file name contains spaces , The order should be written as ren "s0 (1).gif" s001.gif, In short , It's just double quotation marks !!! reason : The system will s0 and (1).gif I think it's two parameters , Plus the following s0 ...

  5. linux Next rename usage -- CHB Renamer

    Linux Of rename There are two versions of the command , One is C Language version of , One is Perl Language version of , In the early Linux The distribution basically uses C Language version of , Now it's hard to see C The language version of , For historical reasons , stay Perl Language ...

  6. linux Next rename usage -- CHB Renamer turn

    Original address :https://www.cnblogs.com/hester/p/5615871.html Linux Of rename There are two versions of the command , One is C Language version of , One is Perl Language version of , In the early Li ...

  7. windows dos Batch rename files

    describe It often appears in work There are some in the same directory A lot of files with the same extension, but the names look messy and different , We want to unify them and rename them to a unified format , It's too much trouble to change names one by one . Here we can use windows Next dos ...

  8. How to use bat Batch rename folders and files

    A long time ago, I wrote an article about renaming a folder , I found some imperfections in it , Its main function is to add characters before the folder name , Or add characters to the folder name , Some netizens think that the function is too single . Today, I have studied it carefully bat Batch code , The difference can be completely ...

  9. [ turn ]Windows Batch rename files under the system (bat Command version )

    Original address :https://jingyan.baidu.com/article/6dad507524bdcba122e36e44.html We sometimes come across a lot of files that need to be renamed ,Windows Right click menu under the system ...

Random recommendation

  1. No mouse Windows operation

    1. Commonly used tab key , Easy to jump 2. Open software mode :  1.win+1,2,3... Open the taskbar icon in order . Common software can be put here : 2. establish quickStart Folder , Configuration path , Put all the functions you need here .( ...

  2. quite a lot k Line shape or k Line combinations need to be verified

    1. Cross stars : It shows the balance of air power . Is it flipped , Need to verify . 2. To reflect the market psychology k The line is what works K Line , Or it's fake k Or counterfeit k Line form .

  3. Xcode The way to add code blocks in

    In the process of writing code , There's a lot of duplicate code ( for instance ,cell Use ), Of course, copy and paste is not bad , however Xcode Provides a very convenient thing . 1. stay Xcode In the lower right corner you'll see a {} Things that are , Here are some common code blocks ...

  4. mysql Query optimization of optimization

    Posted by Money Talks on 2012/02/24 | Chapter one Chapter two Connection optimization part 3 Index optimization 4 Query optimization part 5 Go to the actual combat Query optimization Query optimization involves the use of ...

  5. Ubuntu 16.04 Installation under system PHP5.6*

    Ubuntu 16.04 System default php7, did not php5* My bag , So you need to install it yourself : Method : 1. Delete all php The package lists the installed php package ,dpkg -l | grep php| awk '{print $ ...

  6. Eclipse modify Created Jsp The default format for

    Eclipse Of jsp Template modification open eclipse  choice Window -- Preferences

  7. Linux Command learning

    mkdir -p Create directory (make directorys) p Recursive create ls -l(long)d(direcitory) Show directory or file cd Toggle directory   from "/" Start Directory ,/ ...

  8. Git Take notes

    git Branch :   &. Create a branch       It's easy to create branches :git branch < Branch name >       &. Switch branches      git checkout < Branch name & ...

  9. oracle Partition Inquire about

    Display the information of all partition tables in the database :DBA_PART_TABLES Display all partition table information that the current user can access :ALL_PART_TABLES Display the information of all partition tables of the current user :USER_PART_TABLES Show table scores ...

  10. AngularJS summary

    Because I want to learn about it recently ionic frame , come to know ionic Is based on AngularJS grammar , And through SASS Building the application , I used to use it all the time Vue frame , also Less, Just take this opportunity , To learn AngularJS And SAS ...