Ask a Question
GoPro Support Hub Ask a question. Share an answer. Find a solution. Stay stoked.
Announcements
Is your GoPro gear up to date? Check to see If it is on our Update page.
Cameras
Reply
Tourist
Posts: 3

Bulk rename macOS GoPro files (works on Linux also), to include the Date.

[ New ]

Hi, there is a post ("Scrpt for bulk renaming GoPro files." user Sightseer, spirypike55056, date 03-04-2019) where you can find a way for rename GoPro files, but it works on Windows.

 

Here I share a macOS version for all apple fans (works on Unix/Linux also) ...

 

$ cat addDate2Name.sh 

# Rename GoPro files to include the date at the begining

# You can invoke with a parameter to select only the files you want (MOV, JPG, etc.)

 

TYPE=$1

 

if [ -z $TYPE ]; then

   echo - USE: addDate2Name.sh filetype

else

  for a in $(ls ASTERISK.$TYPE)

  do

     FILE=${a}

     mv $FILE `date -r $FILE "+%Y%m%d_%H%M%S"`_$FILE

  done

fi

IMPORTANT: in the "for" line above replace "ASTERISK" word with the actual asterisk character, I have to put that way because of the rules of this forum "The message body contains asterisk, which is not permitted in this community. Please remove this content before sending your post."

 

Note that the date used to rename is the one that shows in Finder (Windows File Explorer in Mac), if the file doesn't have the

 correct date (if the GoPro camera didn't record this tag correctly), that bad-date will be used in the new name.

Nomad
Posts: 147

Re: Bulk rename macOS GoPro files (works on Linux also), to include the Date.

[ New ]
Would you have reference for the script that works for WIN based computer? I tried search but could not find it. Thanks
Tourist
Posts: 3

Re: Bulk rename macOS GoPro files (works on Linux also), to include the Date.

[ New ]
Tourist
Posts: 3

Re: Bulk rename macOS GoPro files (works on Linux also), to include the Date.

[ New ]

I didn't test it (that post from spirypike55056 user), so, I can't tell you if it works, but at least you can use the main idea.

 

Good luck!

Nomad
Posts: 147

Re: Bulk rename macOS GoPro files (works on Linux also), to include the Date.

[ New ]
Great, I tried it and it works as described. Thanks, great idea