SEANK.H.LIAO

renaming files

renaming files with regex

renaming

Maybe if I write this down I will actually remember next time

shell expansion

uses parameter expansion

quick:

1for f in *.txt; do
2  mv $f "${f%txt}md"
3done
4
5# or with find for more precise targeting
6find . -name '*.txt' -exec sh -c 'f={}; mv $f ${f%txt}md'
zmv

a zsh module in other functions

1zmv '(*).txt' '$1.md'

rename

the one that comes with util-linux on Arch, takes a pattern and what to replace it with and some files, super undocumented

1rename md txt *

perl-rename

basically sed for file names

1perl-rename 's/(.*).md/\1.txt/' *