Online Linux Terminal Logo
OnlineLinuxTerminal
System & ProcessesCLI Reference

$date

Display or set system date and time.

Syntax DefinitionPOSIX standard
date [OPTIONS] [+FORMAT]
Linux Community2.4k Online

Chat with real Linux users, learn new commands & get free cheat sheet PDFs.

Try `date` Live in Interactive Sandbox

Zero-install client simulation with real-time feedback.

Open in Fullscreen Workspace↗
bash — terminal

Overview & How date Works

`date` prints or sets the system date, time, and timezone. In shell scripts, it is commonly formatted (e.g., `date +%Y-%m-%d`) to generate timestamped backup filenames and logs.

Common Flags & Command Options

Flag / OptionDescription
+%Y-%m-%dFormat output as Year-Month-Day (e.g., 2026-08-29).
-u, --utcPrint date and time in Coordinated Universal Time (UTC).

Practical Real-World Examples

Example #1Print current date and time

Outputs the standard system timestamp.

Frequently Asked Questions

How do you format a timestamp for backup filenames?

Run `date +%Y%m%d_%H%M%S` which produces a clean format like `20260829_120000`.