GNU/Linux >> Linux の 問題 >  >> Linux

初心者向けのLinuxzdumpコマンドチュートリアル(例付き)

現在、チームメンバーはさまざまな国で働いているため、さまざまな場所のタイムゾーン情報を認識することが重要になる場合があります。一般に、特定の場所のタイムゾーンをすばやく確認したい場合もあります。 zdumpと呼ばれるコマンドラインユーティリティがあることを知って喜ぶでしょう。 -これで可能になります。

このチュートリアルでは、わかりやすい例を使用して、zdumpの基本について説明します。ただし、その前に、この記事で説明されているすべての例がUbuntu18.04LTSマシンでテストされていることを言及する価値があります。

Linuxzdumpコマンド

Linuxのzdumpコマンドは、基本的にタイムゾーンダンプツールです。その構文は次のとおりです。

zdump [--version] [--help] [-v] [-c [loyear,]hiyear] [zonename...]

そして、manページで説明されているのは次のとおりです。

The zdump program prints the current time in each zonename named on the command line.

以下は、zdumpコマンドがどのように機能するかについての良いアイデアを与えるはずのいくつかの例です。

Q1。 zdumpコマンドの使用方法は?

基本的な使い方はかなり簡単です。場所名を入力として「zdump」を実行するだけです。例:

zdump Singapore

以下は、私のシステムで生成されたコマンドの出力です:

Singapore  Wed Oct 31 17:35:39 2018 +08

他の例を次に示します。

ここで言及する価値があるのは、zdumpを使用して都市固有の情報を取得できることです。次にいくつかの例を示します。

Q2。 zdumpに出力で詳細情報を生成させる方法は?

zdumpで詳細情報を生成する場合は、-vコマンドラインオプションを使用します。たとえば、次のコマンド:

zdump -v Singapore

この出力を生成しました:

Singapore  -9223372036854775808 = NULL
Singapore  -9223372036854689408 = NULL
Singapore  Mon Dec 31 17:04:34 1900 UT = Mon Dec 31 23:59:59 1900 LMT isdst=0 gmtoff=24925
Singapore  Mon Dec 31 17:04:35 1900 UT = Tue Jan  1 00:00:00 1901 SMT isdst=0 gmtoff=24925
Singapore  Wed May 31 17:04:34 1905 UT = Wed May 31 23:59:59 1905 SMT isdst=0 gmtoff=24925
Singapore  Wed May 31 17:04:35 1905 UT = Thu Jun  1 00:04:35 1905 +07 isdst=0 gmtoff=25200
Singapore  Sat Dec 31 16:59:59 1932 UT = Sat Dec 31 23:59:59 1932 +07 isdst=0 gmtoff=25200
Singapore  Sat Dec 31 17:00:00 1932 UT = Sun Jan  1 00:20:00 1933 +0720 isdst=1 gmtoff=26400
Singapore  Tue Dec 31 16:39:59 1935 UT = Tue Dec 31 23:59:59 1935 +0720 isdst=1 gmtoff=26400
Singapore  Tue Dec 31 16:40:00 1935 UT = Wed Jan  1 00:00:00 1936 +0720 isdst=0 gmtoff=26400
Singapore  Sun Aug 31 16:39:59 1941 UT = Sun Aug 31 23:59:59 1941 +0720 isdst=0 gmtoff=26400
Singapore  Sun Aug 31 16:40:00 1941 UT = Mon Sep  1 00:10:00 1941 +0730 isdst=0 gmtoff=27000
Singapore  Sun Feb 15 16:29:59 1942 UT = Sun Feb 15 23:59:59 1942 +0730 isdst=0 gmtoff=27000
Singapore  Sun Feb 15 16:30:00 1942 UT = Mon Feb 16 01:30:00 1942 +09 isdst=0 gmtoff=32400
Singapore  Tue Sep 11 14:59:59 1945 UT = Tue Sep 11 23:59:59 1945 +09 isdst=0 gmtoff=32400
Singapore  Tue Sep 11 15:00:00 1945 UT = Tue Sep 11 22:30:00 1945 +0730 isdst=0 gmtoff=27000
Singapore  Thu Dec 31 16:29:59 1981 UT = Thu Dec 31 23:59:59 1981 +0730 isdst=0 gmtoff=27000
Singapore  Thu Dec 31 16:30:00 1981 UT = Fri Jan  1 00:30:00 1982 +08 isdst=0 gmtoff=28800
Singapore  9223372036854689407 = NULL
Singapore  9223372036854775807 = NULL

マニュアルページでこのオプションを説明する方法は次のとおりです。

 -v   
For each zonename on the command line, print the time at the lowest possible time value, the time
one day after the lowest possible time value, the times both one second before and exactly at each
detected time discontinuity, the time at one day less than the highest possible time value, and
the time at the highest possible time value. Each line ends with isdst=1 if the given time is
Daylight Saving Time or isdst=0 otherwise.

Q3。 -cオプションは何をしますか?

-cオプションは、指定された年の初め近くに冗長な出力をカットします。マニュアルページで説明されている方法は次のとおりです。

-c [loyear,]hiyear

Cut off the verbose output near the start of the given year(s).  The output still includes the
lowest  possible  time  value and one day after it, and the highest possible time value preceded
by the time value one day before it.

次に例を示します。

zdump -v -c 1935 Singapore

そして、これが出力です:

Singapore  -9223372036854775808 = NULL
Singapore  -9223372036854689408 = NULL
Singapore  Mon Dec 31 17:04:34 1900 UT = Mon Dec 31 23:59:59 1900 LMT isdst=0 gmtoff=24925
Singapore  Mon Dec 31 17:04:35 1900 UT = Tue Jan  1 00:00:00 1901 SMT isdst=0 gmtoff=24925
Singapore  Wed May 31 17:04:34 1905 UT = Wed May 31 23:59:59 1905 SMT isdst=0 gmtoff=24925
Singapore  Wed May 31 17:04:35 1905 UT = Thu Jun  1 00:04:35 1905 +07 isdst=0 gmtoff=25200
Singapore  Sat Dec 31 16:59:59 1932 UT = Sat Dec 31 23:59:59 1932 +07 isdst=0 gmtoff=25200
Singapore  Sat Dec 31 17:00:00 1932 UT = Sun Jan  1 00:20:00 1933 +0720 isdst=1 gmtoff=26400
Singapore  9223372036854689407 = NULL
Singapore  9223372036854775807 = NULL
結論

同意します。zdumpコマンドは、私たちのほとんどが毎日必要とする種類のツールではありませんが、いつ必要になるかわからないため、知っておく必要のある便利なユーティリティです。 zdumpの詳細については、manページにアクセスしてください。


Linux
  1. Linuxは初心者向けのコマンドチュートリアルを展開します(例付き)

  2. 初心者向けのLinuxファクターコマンドチュートリアル(例付き)

  3. 初心者向けのLinuxtacコマンドチュートリアル(例付き)

  1. Linuxユーザー初心者向けコマンドチュートリアル(例付き)

  2. 初心者向けのLinuxsumコマンドチュートリアル(例付き)

  3. 初心者向けのLinuxbasenameコマンドチュートリアル(例付き)

  1. Linux yes初心者向けコマンドチュートリアル(例付き)

  2. 初心者向けのLinuxnprocコマンドチュートリアル(例付き)

  3. 初心者向けのLinuxsleepコマンドチュートリアル(例付き)