لینوکس و شبکه

لینوکس و شبکه
طبقه بندی موضوعی
آخرین مطالب
  • ۹۹/۱۱/۱۳
    java

۱ مطلب با کلمه‌ی کلیدی «timedatectl» ثبت شده است

۲۴
شهریور

Timedatectl

بهترین دستور برای کنترل و بررسی سیستم دستور زیر است:
timedatectl
درخروجی این دستور عبارت real time clock یا RTC همان chip درون مادربرد هست که با خاموش شدن کامپیوتر مقدار ساعت را در خود ذخیره و نگهداری می‌کند
در خروجی این دستور عبارت DST یا daylight saving time همان مقدار یک ساعتی هست که در تابستان ساعت ها را به جلو و در زمستان ساعت ها را به عقب می‌کشانند
 
دستورات مفید:
timedatectl set-time 'YYYY-MM-DD HH:MM:SS'		#set time and date
timedatectl set-time HH:MM:SS				#for time only
timedatectl set-time YYYY-MM-DD				#for date only
timedatectl list-timezones				#list the available timezones
timedatectl set-timezone "Asia/Tehran" 			#Set timeZone
timedatectl set-timezone utc				#Set timeZone To UTC
timedatectl | grep local				#Find out if your hardware clock is set to local timezone-BestMode is "no"
timedatectl set-local-rtc 1				#Set hardware clock to local timezone
timedatectl set-local-rtc 0				#Set hardware clock to coordinated universal time (UTC)
timedatectl set-ntp true				#start automatic time synchronization with remote NTP server,
timedatectl set-ntp false				#disable NTP time synchronization
 
 
 
sudo dpkg-reconfigure tzdata				#debian: reconfig timerzone
cat /etc/timezone					#show current timezone
ls -ltrh /etc/localtime					#show current timezone[lrwxrwxrwx 1 root root 31 اوت   21 23:40 /etc/localtime -> /usr/share/zoneinfo/Asia/Tehran]
date							#Show time
date +%Y%m%d-%H%M%S					#Out: 20190707-134444

 

 

1-hwclock -s [or --hctosys]         #تنظیم ساعت سیستم‌عامل از سخت‌افزار
2-hwclock -w [or --systohc]         #تنظیم ساعت سخت‌افزار از سیستم‌عامل
3-hwclock -r [or --show] [or get]   #نمایش ساعت فعلی سخت‌افزار

 

timedatectl set-time 'YYYY-MM-DD HH:MM:SS'
[or]
date --set 2020-07-19
date --set 09:23:14
hwclock -r
hwclock -w
date && hwclock -r

 

 

 

  • behrooz mohamadi nsasab