Linux basic command date command, linuxdate command
1. Time Command: date
The parameter passed to the date command applies to '+' (plus sign). In the parameter passed
% Y indicates year
% M indicates month
% D Indicates day
% H indicates the hour (the time is 00-23)
% M indicates minute
% S indicates second
% S (unix timestamp seconds)
1.1 For example, date + % Y-% m-% d
The result on my machine is:
The output result of the date command is to format the parameters passed at the current time.
1.2 For example, date + '% Y-% m-% d % H: % M: % s'
1.3 obtain the unix timestamp of the current time.
Date + % s
1.4 Use the date command to obtain the unix timestamp of a specific time
The preceding example shows how to obtain the unix timestamp of January 1, October 8, 2014.
In linux, how does one use the date command? Beginner Learning
Date -- help
For more information, see Manual man date.
You can view all commands in this way.
How to Use the date command in linux
Enter only date to display the current time
-D or -- date is used to display a specific date and time, and can be output in format