- "기밀 VM의 빈틈을 메운다" 마이크로소프트의 오픈소스 파라바이저 '오픈HCL'란?
- The best early Black Friday AirPods deals: Shop early deals
- The 19 best Black Friday headphone deals 2024: Early sales live now
- I tested the iPad Mini 7 for a week, and its the ultraportable tablet to beat at $100 off
- The best Black Friday deals 2024: Early sales live now
Displaying dates and times on Linux
$ date +%A Thursday
If you want the month spelled out fully, use a command like this one:
$ date +"%B %d" July 04
Looking forward in time
The date command also allows you to show dates in the future. While you likely know what day tomorrow is, you could use a similar command to display the current time but the next day.
$ date --date="tomorrow" Fri Jul 5 11:12:11 AM EDT 2024
This next command shows the day of the week 2 years in the future.
$ date +%A --date "2 year" Saturday
The next command shows the full date.
$ date --date="2 year" Sat Jul 5 11:14:07 AM EDT 2026
Looking backward in time
You can also use the date command to display dates and times in the past. The commands below show yesterday’s date, the date and time two hours ago and the day of the week from two years ago today.
$ date --date="yesterday" Wed Jul 3 11:19:02 AM EDT 2024 $ date --date "2 hour ago" Thu Jul 4 09:21:23 AM EDT 2024 $ date +%A --date "2 year" Saturday $ date --date="+7 days ago" Thu Jun 27 09:23:07 AM EDT 2024
Multi-line date info
If you want to display date and time information in a multi-line display, insert a newline (%n) string into your date command where the break should occur. Here’s an example: