[SOLVED] Undocumented options of date command and other commands
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Undocumented options of date command and other commands
The other day; I was fiddling with options of `date' command. I found out an option of -I with it. But; this option is not documented anywhere in the man pages & info pages. Google is also not easily yielding result about it.
-ITIMESPEC, --iso-8601[=TIMESPEC]
output date/time in ISO 8601 format.
TIMESPEC=`date' for date only, `hours', `minutes', or
`seconds' for date and time to the indicated precision.
--iso-8601 without TIMESPEC defaults to `date'.
Code:
# Examples in British Summer Time (= Greenwich Mean Time +0100)
date -I
2009-08-12
date -Idate
2009-08-12
date -Ihours
2009-08-12T04+0100
date -Iminutes
2009-08-12T04:02+0100
date -Iseconds
2009-08-12T04:03:26+0100
# Some versions of 'date' can give nano seconds
date -Ins
2009-08-12T04:04:20,582835176+0100
# d,h,m,s,n can be used instead of date,hours,minutes,seconds,ns
Distribution: CentOs 5.3, SuSe 11.1, Solaris 9, Slackware 13
Posts: 78
Rep:
By the way, the same like `date -I` info you will receive if issue command `date` on checkpoint secure plat firewall, where is the really `date` command info you will see if type /bin/date
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.