Skip to Content
Linux in a Nutshell, 6th Edition
book

Linux in a Nutshell, 6th Edition

by Ellen Siever, Stephen Figgins, Robert Love, Arnold Robbins
September 2009
Beginner
942 pages
85h 34m
English
O'Reilly Media, Inc.
Content preview from Linux in a Nutshell, 6th Edition

Name

date

Synopsis

date [options] [+format] [date]

Print the current date and time. You may specify a display format, which can consist of literal text strings (blanks must be quoted) as well as field descriptors, whose values are described in the following entries (the listing shows some logical groupings). A privileged user can change the system’s date and time.

Options

+format

Display current date in a nonstandard format. For example:

$ date +"%A %j %n%k %p"
Friday 051
23 PM

The default is %a %b %e %T %Z %Y (e.g., Fri Feb 20 22:59:43 EST 2009).

-d date, --date date

Display date, which should be in quotes and may be in the format d days or m months d days, to print a date in the future. Specify ago to print a date in the past. You may include formatting (see the following section).

-f datefile, --file=datefile

Like -d, but printed once for each line of datefile.

-r file, --reference=file

Display the time file was last modified.

-R, --rfc-2822

Display the date and time in RFC 2822 format.

--rfc-3339=timespec

Display the date and time in RFC 3339 format. The value of timespec can be one of date, seconds, or ns (nanoseconds) to get the desired degree of precision.

--help

Print help message and exit.

--version

Print version information and exit.

-s date, --set=date

Set the date.

-u, --utc, --universal

Set the date to Coordinated Universal Time, not local time.

Format

The exact result of many of these codes is locale-specific and depends upon your language setting, particularly the LANG environment variable. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Unix in a Nutshell, 4th Edition

Unix in a Nutshell, 4th Edition

Arnold Robbins
Linux Under the Hood

Linux Under the Hood

Sander van Vugt
Linux Kernel in a Nutshell

Linux Kernel in a Nutshell

Greg Kroah-Hartman

Publisher Resources

ISBN: 9780596806088Errata Page