I have a lot of files in folder with filenames like
20190618_213557.mp4
20190620_231105.mp4
20190623_101654.mp4
..
I need to change creati
MACOS Uses touch -mt to change file creation/modification time. Here is the script:
#!/bin/bash
FILES="/Users/shakirzareen/Desktop/untitledfolder/*"
for f in $FILES ## f = full path + filename
do
t="${f##*/}" ##remove folder path from filename
t2="${t//_}" ##remove _ from filename
t3="${t2%%.*}" ##remove file extension part
touch -mt "$t3" $f ##set creation and modification time of file
done