1. Get the various usages of today's date:
[Email protected] ~]# date +%y_%m_%d
2016_05_22
[[Email protected] ~]# Date ' +%y_%m_%d '
2016_05_22
[[Email protected] ~]# date "+%y_%m_%d"
2016_05_22
[[Email protected] ~]# date + '%y_%m_%d '
2016_05_22
[[Email protected] ~]# date + "%y_%m_%d"
2016_05_22
[Email protected] ~]# date-d today +%y_%m_%d
2016_05_22
[Email protected] ~]# date-d today ' +%y_%m_%d '
2016_05_22
[Email protected] ~]# date-d Today "+%y_%m_%d"
2016_05_22
[Email protected] ~]# date-d today + '%y_%m_%d '
2016_05_22
[Email protected] ~]# date-d today + "%y_%m_%d"
2016_05_22
2. Note: There must be a space after date, and no space after it, and the use of single and double quotation marks.
3. If used with other commands, you need to use the anti-quote "", the keyboard is located in the exclamation point! The ~ key on the left. For example:
[Email protected] ~]# echo ' date-d today +%y_%m_%d '
2016_05_22
[[email protected] ~]# echo ' date-d today + '%y_%m_%d '
2016_05_22
[Email protected] ~]# echo ' date-d today + "%y_%m_%d" '
2016_05_22
How to get the time of the day in 4.oracle:
Sql> Select To_char (sysdate, ' Yyyy_mm_dd ') from dual;
2016_05_22
Linux the date command gets the usage of today's Day