MYSYSAD.COM

Date Command in Debian Linux

· Shell & text

Here are some interesting uses of the date command in Debian Linux by Mary M. Chaddock, GSEC, GCUX. She is a Network Security Administrator for Abilene Christian University in Texas. Thanks Mary for the nice email, and of course, the Debian date tip.

Mary said, "Specifically, I often have a need to convert log dates or search logs for specific dates when the log date is in epoch format."

Displays the current date
'date +%s'

Gives date two weeks ago
'date +%s --date=-2week'

Converts an epoch timestamp
'date --date=@1187103930'