Tuesday, December 24, 2024

Linux - Date

The following is a Linux Dictionary word of the day:

date displays or changes the date & time.

-s = parameter for set.

Example: date

Example: Displays the date in the format of mm/dd/yy then the time in the format of hours:minutes:seconds:

date "+DATE: %m/%d/%y%nTIME: %H:%M:%S"

" – starts display line.

+DATE: option to concatenate the word DATE: on the output line.

%m option to display month.

%d option to display date.

%y option to display year.

%n option for a new line.

displays the date in the format as mm/dd/yy.

TIME: option to concatenate word TIME: on the output line.

%H: option for hour.

%M option for minutes.

%S option for seconds

" end of display line.



As an Amazon Associate, I earn from qualifying purchases.


No comments:

Post a Comment