johno

Rename all files in a directory

The following bash script changes all .md files to .mdx.

for file in *.md
do
  mv "$file" "${file%.md}.mdx"
done

Or all in one line:

for file in *.md; do mv "$file" "${file%.md}.mdx"; done