728x90
반응형
파일들이 있는 폴더로 들어가서 아래 명령어 실행.
for file in *; do mv "$file" `echo $file | tr ' ' '_'`; done
그럼 기존 띄어쓰기가 있던 파일이 일괄적으로 _로 변경됨
ex) "샘플 이미지.jpg" >> "샘플_이미지.jpg"
https://www.linuxadictos.com/ko/reemplazar-espacios-por-guiones-bajos.html
파일 이름의 공백을 밑줄로 바꾸는 방법
공백이있는 이름으로 콘솔이나 터미널에서 작업 할 때 문제가있는 사람 중 하나입니다. 왜냐하면 이것을 읽으면 그만두 게 될 것이기 때문입니다.
www.linuxadictos.com
- 파일명에 번호 붙이기
ls -v | cat -n | while read n f; do mv -n "$f" "$n.확장자명"; done
https://stackoverflow.com/questions/3211595/renaming-files-in-a-folder-to-sequential-numbers
Renaming files in a folder to sequential numbers
I want to rename the files in a directory to sequential numbers. Based on creation date of the files. For Example sadf.jpg to 0001.jpg, wrjr3.jpg to 0002.jpg and so on, the number of leading zeroes
stackoverflow.com
- 파일 확장자 일괄 변경
# .jpg를 .png로 변경
for f in *.jpg; do mv -- "$f" "${f%.jpg}.png"; done
728x90
반응형