Showing posts with label Rename bulk files. Show all posts
Showing posts with label Rename bulk files. Show all posts

Monday, December 14, 2020

Me-rename semua file dalam satu folder

Merename atau mengkonversi file satu per satu sangat melelahkan dan menyita waktu. Untungnya ada perangkat dan jalan pintas untuk melakukan pekerjaan tersebut: shell.

Merename


Mengubah nama file pdf, misal dari 001.pdf, 002.pdf, dst menjadi 001-bta.pdf, 002-bta.pdf bisa dilakukan secara batch atau berrombongan. Caranya sebagai berikut:
for i in *.sql ; do
    mv -v $i ${i%.sql}-bta.sql
done

Ganti "bta" dengan suffiks yang diinginkan.

Menkonversi (pdf ke png)

Sebagai contoh adalah konversi semua file pdf dalam satu folder ke file png, karena ukuran file .png lebih kecil dan lebih cepat diload (dalam presentasi). Perintah berikut akan mengubah semua file pdf ke png. Perangkat yang digunakan adalah "convert" (imagemagick).
for i in *.pdf; 
do convert $i ${i%.pdf}.png; 
done

Cara lain yang lebih sederhana pernah saya tulis disini > https://bagustris.blogspot.com/2012/01/bulk-rename-files-in-ubuntu-linux.html

Saturday, January 07, 2012

Bulk Rename Files in Ubuntu / Linux

If you have a lot of files to be renamed, it will waste your time to rename files manually (for example, change file names from camera). If you want to change the capital or uppercase files name to lowercase, you can do the following command in your terminal in the current directory,
ls | while read upName; do loName=`echo "${upName}" | tr '[:upper:]' '[:lower:]'`; mv "$upName" "$loName"; done
But, if you want to change file names, find and replace, or others, you can do the following command:

for filename in */*240p*; 
do echo mv \"$filename\" \"${filename//240p/}\"; 
done

In that case, the command will remove "240p" in the directory and in its lower folder. For example, the file with the name like week2-360p.mp4 will be renamed to be week2.mp4

Another way is to do bulk rename is by installing thunar (GUI-based),
sudo apt-get install thunar

And then use the bulk rename program from thunar as shown in the following screenshot. You can insert date / time, insert / overwrite, search and replace, numbering and also uppercase / lower case. Let's try!
Thunar bulk rename in Ubuntu / Linux

Source:
- https://ubuntuforums.org/archive/index.php/t-1336909.html
Related Posts Plugin for WordPress, Blogger...