rdate Command in Linux with Examples

This tutorial explains Linux “rdate” command, options and its usage with examples.

rdate – get the time via the network


rdate displays and sets the local date and time from the host name or address given as the argument. The time source may be an RFC 868 TCP protocol server,or an RFC 2030 protocol SNTP/NTP server. By default, rdate uses the RFC 868 TCP protocol.
1) Remote server should run the time service in port 37.
2) Firewall should not block port 37.

A list of Nework Time servers is available on: http://ntp.isc.org/bin/view/Servers/WebHome


rdate [-46acnpsuv] [-o port] host



Forces rdate to use IPv4 addresses only.
Forces rdate to use IPv6 addresses only.
Use the adjtime call to gradually skew the local time to the remote time rather than just hopping.
Correct leap seconds. Sometimes required when synchronizing to an NTP server.
Use SNTP instead of the RFC 868 time protocol.
-o port
Use port port instead of port 37.
Do not set, just print the remote time.
Do not print the time.
Use UDP instead of TCP as transport.
Verbose output. Always show the adjustment.


1. Print the time returned by the remote machine.

Note: Join free Sanfoundry classes at Telegram or Youtube
$ rdate -p

2. Set the system time to the time returned by the remote machine (Need Root permission).

# rdate -s remote.pc.com

3. Use UDP instead of TCP as the transport.

# rdate -u myserver

4. Use syslog to log errors and output

# rdate -l myserver

5. To to set the time through an ssh tunnel, use something like so:

# ssh -f -L 10037:time.example.com:37 tyr.example.com sleep 10
# rdate -a -o 10037 locahost

Sanfoundry Global Education & Learning Series – 1000 Linux Tutorials.

If you wish to look at all Linux commands and their usage examples, go to Linux Commands Tutorial.

Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.