i have not been blogging for quite some time, i noticed when replacing the blog software; so now i keep constantly thinking about what i may blog, so a little more density in the posts evolves ;-)

here's today's note; i just needed it and figured someone might say "aaw! that's useful" - a one-liner to use in bash for changing the extension of given files in a directory. bash is the shell that is by default installed in mac os x, and opens when you start the "Terminal" application. It is also the default in almost all linux distributions.

in this example, i rename all .mp4 files to .m4v (thanks, ps3...). adapt as needed.
for i in *.mp4 ; do mv "$i" "${i%%mp4}m4v" ; done
the %% operator strips the string following it from the end of the variable's content. the ## operator does the same, but at the beginning of the string.