You need to add "gt_" in front of the file names of all txt files in the folder; That is, the original file "xxx.txt" becomes "gt_xxx.txt": The script I searched online is as follows: for i in `ls`; do mv -f $i 'echo "gt_"$i`; done 1. First, switch the Linux command line to the directory where you need to modify the file name: cd destination directory 2. Create a new sh file in this directory: 3. Open the xxx.sh file: 3. Copy the script content just now to the sh file, save and exit Edit sh file: Shift+I Save and exit after pasting: Ctrl+Alt +D to exit the editing state, then enter :wq! to exit Execute sh file: ./xxx.sh I have never come across Linux commands before, and now I need to use some of them. I am taking this note as a reminder~~~ ps: Batch change file prefix command under linux for f in * ; do mv -- "$f" "PRE_$f" ; done Summarize The above is the operation method of adding file prefixes in batches in Linux introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Vue uses v-model to encapsulate the entire process of el-pagination components
>>: Detailed graphic tutorial on installing and uninstalling Tomcat8 on Linux
Table of contents (1) Introduction: (2) The ways ...
When you first start learning Linux, you first ne...
Preface Recently, I took over a client's nati...
Table of contents 1. Why Redux 2. Redux Data flow...
This article shares the specific code of JavaScri...
You need to add "gt_" in front of the f...
1. Add PRIMARY KEY (primary key index) mysql>A...
How to reset the initial value of the auto-increm...
1. Create the backup.sh script file #!/bin/sh SOU...
Preface The need for real-time database backup is...
Step 1: Install Stow In this example, we are usin...
Table of contents As a global variable Variable H...
The appearance of a web page depends largely on i...
After installing MySQL, you will find that the ro...
History of ZFS The Z File System (ZFS) was develo...