[rename] [rename] [rename] [rename] [rename] [rename]
zsh: command not found: rename
So use Homebrew to install it first:
➜ ~ brew install rename
After that, you can directly use a simple one-line command to change the name of multiple files. The general format is as follows:
➜ ~ rename 's/old/new/' *.files
Ex. :
Change the prefix of batch PNG files from ‘ic_’ to ‘ic_setting_’ :
(ic_launcher.png -> ic_setting_launcher.png)
➜ ~ rename 's/ic_/ic_setting_/' *.png
Modify part names of batch files:
(ic_setting_launcher.png -> ic_launcher.png)
➜ ~ rename 's/_setting//' *.png
Supplement:
You can also use :
to change the first five letters to XXXXX (note ^… It’s five.
for i in `ls`; do mv -f $i `echo $i | sed 's/^...../xxxxx/'`; done
Usage is almost the same, the rest is up to us to flexibly use.
Read More:
- Bash modifies the file names in the specified folder through MAC terminal (batch modification)
- Adding prefixes to file names in batch by shell under mac
- Batch rename files on MAC (add prefix and suffix)
- How does a Mac terminal exit the python command line
- Linux command line cursor moving skills
- ruby 2.1.1 rails 4.2.0 Install gemset mysql command line tool for mac osx
- Command line is too long. Shorten command line for QuestionnaireApplication or also for Spring Boot
- How to terminate the current program under linux command line?
- Idle line number setting and linenumbers modification
- 13. R language: Error in match.names(clabs, names(xi)): The name is not relative to the original name
- In windows, “cmake” is not an internal or external command, nor a runnable program or batch file.
- R language error in match.names (clabs, names(xi)) :
- Error running ‘application’: command line is too long. Short command line for application
- Method of modifying file and folder permission by Chmod command in Linux
- Linux edit save file command
- Samba mount directory file rename strange failure
- Command failed with error 16412: ‘FieldPath field names may not contain ‘.‘.‘ on server 10.21.20.8:2
- Fileexistserror: [winerror 183] cannot create a file when it already exists. File rename code attached
- Solution to command line option syntax error. Type command /? For help