====== rename ====== * 파일명을 일괄 변환하는 리눅스 명령어 * [[http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html|Howto: Linux Rename Multiple Files At a Shell Prompt - nixCraft]] * see [[linux:prename|prename perl-rename]] ===== 동영상/자막 파일 일괄 리네임 ===== # Something.awsome.S01E01.blah.smi to S01E01.smi or srt rename 's/.*(S\d+E\d+).*(s[mr][it])$/$1.$2/g' *.s?? # Something.awsome.S01E01.blah.avi to S01E01.avi rename 's/.*(S\d+E\d+).*$/$1.avi/g' *.avi ===== 순서에 따라 파일이름 바꾸기 ===== * http://stackoverflow.com/questions/3211595/renaming-files-in-a-folder-to-sequential-numbers find -name '*.jpg' | gawk 'BEGIN{ a=1 }{ printf "mv \"%s\" %03d.jpg\n", $0, a++ }' | bash # 혹은 ls *.mkv | gawk 'BEGIN { a = 1 } { printf "mv \"%s\" %03d.mkv\n", $0, a++ }' | bash ===== Prefix 붙이기 ===== for f in * ; do mv "$f" "PRE_$f" ; done ===== Bulky ===== * [[https://ubuntuhandbook.org/index.php/2021/07/linux-mint-bulky-file-renamer-ubuntu-20-04/|How to Install Linux Mint’s New ‘Bulky’ File Renamer in Ubuntu 20.04 | UbuntuHandbook]] * https://github.com/linuxmint/bulky ===== qmv ===== sudo apt install renameutils * 파일명을 변경할 디렉토리에서 ''qmv'' 실행하고 편집 ===== vimv ===== * [[https://github.com/thameera/vimv|thameera/vimv: Batch-rename files using Vim]] ===== krename ===== * [[https://github.com/KDE/krename|krename]] KDE용 rename ===== 참조 ===== * [[https://ostechnix.com/how-to-rename-multiple-files-at-once-in-linux/|6 Methods To Rename Multiple Files At Once In Linux]] * [[https://snapcraft.io/smart-file-renamer|Install Smart File Renamer on Linux | Snap Store]] * [[https://www.makeuseof.com/batch-rename-files-in-linux/|The 7 Best Ways to Batch Rename Files in Linux]] * [[https://www.linuxlinks.com/best-free-open-source-gui-batch-renamers/|6 Best Free and Open Source GUI Batch Renamers - LinuxLinks]]