可以查看帮助手册
man date
常用的几个;
- 显示当年的第几周
date +%V // %V ISO week number, with Monday as first day of week (01..53)
- 显示当年的第几天
date +%j
- 显示年份
date +%G
扩展,python获取
root@jason:~# python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> datetime.datetime.now().isocalendar()
(2019, 27, 5)
>>>