a single bash script that helps you renaming (so organizing) thousands of snaps, videos, whatever
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jrm 82baaaac0d adding mediasubdir 6 months ago
LICENSE Initial commit 6 months ago
README.md first commit 6 months ago
mediaprefixer2.sh first commit 6 months ago
mediasubdir.sh adding mediasubdir 6 months ago

README.md

Mediaprefixer.sh

Imagine a single bash script that helps you renaming (so organizing) thousands of snaps, videos, whatever

What is this bash script about ?

Let's take an example; you are facing that kind of photos and videos folder of your own :

a4c7614c-16d2169ab10ff74cbbf6b15265be786ca20d16ea.jpeg
DJI_0301.mp4
IMG_3031.dng
IMG_3037.cr3
R0001820.jpg
R0001821.jpg
R0001822.jpg
R0001823.jpg
VID_20190912_110900.mp4

Well, using mediaprefixer.sh that way :

find -type f -exec mediaprefixer2.sh {} \;

Makes all your files organizable :

20160912-110900--VID_20190912_110900.mp4
20181031-115920--IMG_3031.dng
20181031-115935--IMG_3037.cr3
20191031-115948--DJI_0301.mp4
20201031-115949--R0001820.jpg
20201031-115950--R0001821.jpg
20201031-115955--R0001822.jpg
20201031-120001--R0001823.jpg
20211031-121042--a4c7614c-16d2169ab10ff74cbbf6b15265be786ca20d16ea.jpeg

You see ? It's extracting & adding the EXIF datetime to your filenames, so you can get the upper hand !

Prerequisite

You need to install ExifTool first. So download it and install it that way :

perl Makefile.PL
make -j$(nproc) test
sudo make -j$(nproc) install

Usage

On a single file :

mediaprefixer2.sh <filename>

On a single file (dry mode, the file won't be renamed) :

mediaprefixer2.sh <filename> DRY

And if you wanna use mediaprefixer.sh on many pictures & videos, just use find :

find -type f -exec mediaprefixer2.sh {} \;

Credits

I needed that kind of script so ... I created it !

This is my /now page