DEV Community

Discussion on: Bash: Rename specific files in a folder

Collapse
 
miku86 profile image
miku86

Hey Ryan,

did you manage to achieve your goal?

I would try something like this:

# * wildcard for all files
for file in *
do
  # -v will show you what has been done.
  mv -v "$file" "$file.yourdesiredextension"  
done
Collapse
 
rjmoise profile image
Ryan

Seeing your post inspired me to tackle it once again and I had just got it working before your comment! I don't do bash scripting very often but it is something I am trying to commit to doing more often.
Thanks.

Thread Thread
 
miku86 profile image
miku86

Awesome, congrats!

Yeah, me too, I don't use it that much.