How to use the date command under Linux in Linux, the date command is a very common command that we often need to use to view system time, set system time, and so on. 1. Set the system time directly using the date commandsuch as: Set the system time is October 1, 2015 12:30 18 seconds# date 100112302015.18or# date-s "2015-10-01 12:30:18" 2. Date commands that are commonly used in scriptsShow Current year date +%yDisplays the current month date +%mshows which day the date +%dDisplays the current month and day format date +%y%m%d date +%y/%m%d .... 3, date-d parameterin scripting, date-d is very usefulif the day before is displayeddate-d ' 1 days ago ' or date-d yesterday +%y%m%dTomorrow's datedate-d next-day +%y%m%dNext Monday timedate-d ' next Monday '
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.