know how to use date command and its examples

  • About date : To print or set the system date and time
  • Comes From : coreutils-8.4-9.el6.i686

Examples:

1. To display the date and time

$ date

2. To display the date and time entered by time

$ date –date=hh:mm:dd:mm:yy

3. To print the date from formats specified in each line of file

$ date -f file.txt
$ date –file file.txt

4. To get the last modification time for a file.

$ date file.txt

5. To output date and time in RFC 2822 format

$ date -R
$ date –rfc-2822

6. To output date and time in RFC 3339 format

$ date –rfc-3339

7. To set the time specified by the time

$ date -u
$ date –utc
$ date –universal

8. To display the version information

$ date –version

Leave a Reply

Your email address will not be published. Required fields are marked *