0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[Linux] ローカリゼーション_タイムゾーン_tzselect, tzconfig, cp, ln, export

Last updated at Posted at 2025-06-25

概要

tzselect コマンド

$ tzselect
オプション 由来 説明
default timezone select 対話形式で地域を選択し、環境変数 TZ の設定方法を表示
例:export TZ='Asia/Tokyo'

tzconfig コマンド(Debian系)

$ tzconfig
オプション 由来 説明
default timezone config 対話形式でタイムゾーンを選択し、
/etc/timezone/etc/localtime を更新する

cpコマンド(推奨)

$ cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
コマンド 用途 説明
cp ファイルをコピー /usr/share/zoneinfo/地域/都市 のタイムゾーンファイルを /etc/localtime にコピーして反映
備考 永続的な設定にするには /etc/timezonetimedatectl も併用推奨

ln -sコマンド(リンク型)

$ sudo ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
コマンド 用途 説明
ln -s シンボリックリンクを作成する /etc/localtime/usr/share/zoneinfo/... へのリンクに変更してタイムゾーンを指定
ln -sf 強制 既存の /etc/localtime を上書きしてリンクを張り直す

exportコマンド(セッションのみ有効)

$ export TZ='Asia/Tokyo'
コマンド 用途 説明
export 環境変数の設定 カレントシェルセッション内のみに有効な一時的タイムゾーン設定(ログインし直すと元に戻る)

Ping-t

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?