الفلاتر
طريقة البحث
  • الكلمات العادية تجد الأسماء والنصوص والأمثلة.
  • "كلمتان" تجد العبارة بالضبط.
  • --name أو -x تجد خيارًا.
  • #كلمة تبحث داخل الأوامر فقط.
  • @grep تجد الدروس والمعامل التي تستخدم grep.
  • الفلاتر: cat:network · in:labs · level:rhcsa · ch:8 · root:yes. ضع ! قبل كلمة لاستبعادها. OR بين الكلمات تعني إحداها.
  • ↑ ↓ للتنقل · Enter للفتح · Esc للإغلاق · / للبحث

timedatectl

Show and change the system time, the time zone, the RTC mode and whether NTP sync is on.

المستوى
امتحان RHCSA
المجموعة
الوقت
يحتاج root
للتغييرات
الحزمة
systemd

هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.

ماذا يفعل

Without arguments timedatectl shows local time, UTC, RTC time, time zone, whether the clock is synchronized and whether the NTP service (chronyd) is active. Subcommands change these settings.

طريقة الكتابة

timedatectl [OPTION]... [COMMAND]

الأجزاء الرئيسية

status
Show the settings (default).
show
Settings as key=value (for scripts).
set-time "YYYY-MM-DD HH:MM:SS"
Set the clock (NTP must be off).
set-timezone ZONE
Set the time zone.
list-timezones
All zone names.
set-local-rtc 0|1
RTC in UTC (0) or local time (1).
set-ntp true|false
Turn NTP sync (chronyd) on or off.
timesync-status, show-timesync, ntp-servers, revert
For systemd-timesyncd (not used by default on RHEL).

الخيارات 11

الأكثر استخدامًا

--adjust-system-clock
With set-local-rtc: also set the system clock from the RTC.
-p, --property=NAME
With show: only these properties.
-a, --all
With show: all properties.
--value
With show: only the values.
--monitor
With timesync-status: keep updating.
--no-ask-password
No password questions.
--no-pager
Do not use a pager.
-H, --host=HOST
Remote host over SSH.
-M, --machine=NAME
A container.
-h, --help
Show help.
--version
Show the version.

أمثلة 10

$ مستخدم عادي# بصلاحية root (أو مع sudo)

  1. 1Show all settings

    timedatectl
                   Local time: Sun 2026-10-25 11:42:10 +03
               Universal time: Sun 2026-10-25 08:42:10 UTC
                     RTC time: Sun 2026-10-25 08:42:10
                    Time zone: Asia/Riyadh (+03, +0300)
    System clock synchronized: yes
                  NTP service: active
              RTC in local TZ: no

    Everything at once.

  2. 2Set the time zone

    timedatectl set-timezone Asia/Riyadh

    Changes the /etc/localtime link.

  3. 3Find a zone name

    timedatectl list-timezones | grep -i amsterdam
    Europe/Amsterdam

    Exact names are needed.

  4. 4Turn NTP on

    timedatectl set-ntp true

    Starts and enables chronyd.

  5. 5Set the time by hand

    timedatectl set-ntp false
    timedatectl set-time "2026-10-25 12:00:00"

    Only for labs without a time server.

  6. 6RTC in UTC

    timedatectl set-local-rtc 0

    Recommended for servers.

  7. 7Value for a script

    timedatectl show -p NTPSynchronized --value
    yes

    Monitoring check.

  8. 8Check many servers

    for h in server1 server2; do ssh $h timedatectl show -p Timezone --value; done

    Same zone everywhere?

  9. 9Time zone link

    ls -l /etc/localtime
    lrwxrwxrwx. 1 root root 33 Oct 25 11:40 /etc/localtime -> ../usr/share/zoneinfo/Asia/Riyadh

    What set-timezone changed.

  10. 10Unsynced clock alert (security)

    [ "$(timedatectl show -p NTPSynchronized --value)" = yes ] || echo "clock not synced"

    Wrong time breaks TLS, Kerberos and log analysis.

رموز الخروج

0Done.
1Error.

الدليل الكامل

هذه الصفحة تشرح الأمر بكلمات بسيطة. الدليل الأصلي فيه كل التفاصيل.

في الطرفية: man timedatectl