AppleTerm 에서 ls 를 했을 때 한글 파일명이 깨져 나오면

Computing 2010. 8. 3. 22:37

ls 에 -v 옵션을 주면 된다.

$ man ls
....
     -v      Force unedited printing of non-graphic characters; this is the default when output is
             not to a terminal.

그래서 내 .bashrc 는 이렇게 해 두고 있다 :


shawn.deltabellun:~/env$ cat _deltabellun.local
# ATAF and gvimrc font
export OS_NAME=osx

# prompt color Setting
PROMPT_COLOR='0;35'

# LOCALE setting
export LANG=ko_KR.UTF-8
export LC_MESSAGES=C
export LC_CTYPE=C
export LC_TIME=C

# On OSX or local ubuntu, the host has its own xserver
USE_LOCAL_X_SERVER='yes'

# display username and hostname in the terminal's title bar
USE_PROMPT_COMMAND='yes'

# ls of OSX does not print multibyte characters.
# if ls is given -v option, it prints multibyte characters.
LS_MULTIBYTE_OPTION='-v'
...
shawn.deltabellun:~/env$ cat bashrc
ENVDIR=${HOME}/env

export HOSTNAME=`hostname`

#########################################################
# Load host specific setting file
#########################################################
source ${ENVDIR}/_${HOSTNAME}
source ${ENVDIR}/functions
...
#########################################################
# ALIASES
#########################################################

alias l="ls -F ${LS_COLOR_OPTION} ${LS_MULTIBYTE_OPTION}"
alias ll="ls -laF ${LS_COLOR_OPTION} ${LS_MULTIBYTE_OPTION}"
alias ls="ls -F ${LS_COLOR_OPTION} ${LS_MULTIBYTE_OPTION}"

자세한 것은 svn https://orchistro-env.googlecode.com/svn/trunk/ 에 있는 내 환경 설정 파일을 참고.

: