Date
From Wsms
Note: This page should be titled date (all lowercase). It is Date due to technical limitations of Mediawiki.
[edit]
date
date is a linux command to retrieve the current date and time.
[edit]
usage
Date has some cool formatting options for the output
Print the date in the default format:
ggeller@roosevelt:~$ date Mon Oct 6 10:01:51 PDT 2008
Print just the year:
ggeller@roosevelt:~$ date +%Y 2008
Print the year, month, day, minutes and hours:
ggeller@roosevelt:~$ date +%Y%m%d-%H%MHRS 20081006-1005HRS
Make an empty file with a name containing a time-stamp:
ggeller@roosevelt:~$ touch notes-`date +%Y%m%d-%H%MHRS` ggeller@roosevelt:~$ ls -l notes-20081006-1007HRS -rw-r--r-- 1 ggeller ggeller 0 2008-10-06 10:07 notes-20081006-1007HRS
[edit]
see also
man date
