티스토리 뷰

Install rename library

$ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following new directories will be created:
/usr/local/sbin
/usr/local/Frameworks
==> /usr/bin/sudo /bin/mkdir -p /usr/local/sbin /usr/local/Frameworks

$brew install rename
==> Downloading https://homebrew.bintray.com/bottles/rename-1.601.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring rename-1.601.mojave.bottle.tar.gz
🍺  /usr/local/Cellar/rename/1.601: 4 files, 44.5KB
➜  downloads

 


Rename File

확장자명이 대문자 HTML 인 파일들을 모두 소문자 html로 변경한다.

$ls -al
total 0
drwxr-xr-x   5 mhkim  staff   160 11  4 13:57 .
drwxr-xr-x  70 mhkim  staff  2240 11  4 13:39 ..
-rw-r--r--   1 mhkim  staff     0 11  4 13:40 aaa.HTML
-rw-r--r--   1 mhkim  staff     0 11  4 13:40 bbb.HTML
-rw-r--r--   1 mhkim  staff     0 11  4 13:40 ccc.HTML

$rename -fv 's/\.HTML/\.html/' *
'aaa.HTML' renamed to 'aaa.html'
'bbb.HTML' renamed to 'bbb.html'
'ccc.HTML' renamed to 'ccc.html'

$ls -al
total 0
drwxr-xr-x   5 mhkim  staff   160 11  4 13:59 .
drwxr-xr-x  70 mhkim  staff  2240 11  4 13:39 ..
-rw-r--r--   1 mhkim  staff     0 11  4 13:40 aaa.html
-rw-r--r--   1 mhkim  staff     0 11  4 13:40 bbb.html
-rw-r--r--   1 mhkim  staff     0 11  4 13:40 ccc.html
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크