ANOTHER EXAMPLE - Full Replace and Replace + Append to file name
1
2
3
4
i=0;for file in*.jpg;do i=$((i+1));echo"$i";done# only show Number from 1 to n filei=0;for file in*.jpg;do i=$((i+1));echo"$i";mv"${file}""${file/$file/$i-img.jpg}";done
i=0;for file in*.jpg;do i=$((i+1));echo"$i";mv"${file}""${file/$file/$i.jpg}";done
i=0;for file in*.jpg;do i=$((i+1));echo"Ke $i : $file";done# only show file
6. Command Line : example FROM “[CooL GuY] [[a2zRG]] (42).jpg” TO “CooLGuYa2zRG42.jpg”
1
2
3
4
5
6
7
for file in*.jpg;do mv"${file}""${file/[/}";done
for file in*.jpg;do mv"${file}""${file/]/}";done
for file in*.jpg;do mv"${file}""${file/'[['/}";done# [[ --> maksudnya double '{'for file in*.jpg;do mv"${file}""${file/']]'/}";done# ]] --> maksudnya double '}'for file in*.jpg;do mv"${file}""${file/'('/}";done
for file in*.jpg;do mv"${file}""${file/')'/}";done
for file in*.jpg;do mv"${file}""${file/ /}";done
7. Dalam bash script
1
2
3
4
5
#!/bin/bashfor file in*.jpg;do
mv"$file""${file/(/}"# remove character "("mv"$file""${file/)/_}"# replace character "(" with "_"done
Menggunakan MMV [ Multiple Files MV ]
How do I use mmv command
To convert all filenames to lowercase, enter
1
mmv "*""#l1"
To rename all *.bakz files in the current directory to *.bak