DB,서버,OS 등
[Centos] centos6,7 timezone 변경하기
bryan.oh
2020. 4. 7. 22:15
반응형
CentOS timezone config files and directories
1. / usr / share / zoneinfo / – 시스템 시간대 디렉토리에는 시간대 이름 별 파일이 포함됩니다.
예를 들어, / usr / share / zoneinfo / America / New_York 파일은 뉴욕의 시간대를 나타냅니다.
2. / etc / localtime – 파일 localtime 또는 / usr / share / zoneinfo / 디렉토리에있는 시스템의 올바른
시간대 파일에 대한 심볼릭 링크입니다.
- 시간을 확인하는 command
$ date
$ ls -l /etc/localtime
CentOS 7 에서 현재 timezone 변경
# 아시아의 타임존 리스트 보기
$ timedatectl list-timezones | grep Asia
서울로 타임존 변경하기
$ timedatectl set-timezone Asia/Seoul
CentOS 6 에서 현재 timezone 변경
(또는 CentOS7에서 timedatectl 을 사용 못할때)
# 백업
$ cp /etc/localtime /root/old.timezone
$ rm /etc/localtime
# 또는 rm -rf /etc/localtime
# Asia/Seoul 로 설정
$ ln -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime
변경 후 확인
$ date
728x90
반응형