位置: 编程技术 - 正文

Linux命令之日期时间命令date使用实例(linux显示日期格式命令是)

编辑:rootadmin

推荐整理分享Linux命令之日期时间命令date使用实例(linux显示日期格式命令是),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:linux日期运算,linux日期加减,linux中日期时间的表示方法有,linux日期函数,linux如何设置日期,linux日期格式,linux日期函数,linux 日期命令,内容如对您有帮助,希望把文章链接给更多的朋友!

date用法1:

格式:date [OPTION]... [+FORMAT]

FORMAT controls the output. Interpreted sequences are:

%% a literal %

%a locale's abbreviated weekday name (e.g., Sun)

%A locale's full weekday name (e.g., Sunday)

%b locale's abbreviated month name (e.g., Jan)

%B locale's full month name (e.g., January)

%c locale's date and time (e.g., Thu Mar 3 :: )

%C century; like %Y, except omit last two digits (e.g., )

%d day of month (e.g., )

%D date; same as %m/%d/%y

%e day of month, space padded; same as %_d

%F full date; same as %Y-%m-%d

%g last two digits of year of ISO week number (see %G)

%G year of ISO week number (see %V); normally useful only with %V

%h same as %b

%H hour (..)

%I hour (..)

%j day of year (..)

%k hour, space padded ( 0..); same as %_H

%l hour, space padded ( 1..); same as %_I

%m month (..)

%M minute (..)

%n a newline

%N nanoseconds (..)

%p locale's equivalent of either AM or PM; blank if not known

Linux命令之日期时间命令date使用实例(linux显示日期格式命令是)

%P like %p, but lower case

%r locale's -hour clock time (e.g., :: PM)

%R -hour hour and minute; same as %H:%M

%s seconds since -- :: UTC

%S second (..)

%t a tab

%T time; same as %H:%M:%S

%u day of week (1..7); 1 is Monday

%U week number of year, with Sunday as first day of week (..)

%V ISO week number, with Monday as first day of week (..)

%w day of week (0..6); 0 is Sunday

%W week number of year, with Monday as first day of week (..)

%x locale's date representation (e.g., //)

%X locale's time representation (e.g., ::)

%y last two digits of year (..)

%Y year

%z +hhmm numeric time zone (e.g., -)

%:z +hh:mm numeric time zone (e.g., -:)

%::z +hh:mm:ss numeric time zone (e.g., -::)

%:::z numeric time zone with : to necessary precision (e.g., -, +:)

%Z alphabetic time zone abbreviation (e.g., EDT)

By default, date pads numeric fields with zeroes. The following optional flags may follow `%':

- (hyphen) do not pad the field

_ (underscore) pad with spaces

0 (zero) pad with zeros

^ use upper case if possible

# use opposite case if possible

例如:

1.年月日复制代码代码如下:$ date +%Y%m%d.年月日,年只保留后两位复制代码代码如下:~$ date +%y%m%d.小时分钟秒复制代码代码如下:~$ date +%H%M%S.年月日时分秒复制代码代码如下:~$ date +%Y%m%d%H%M%S

Linux命令之排序命令sort使用实例 名称:sort位置:/usr/bin/sort权限:所有用户用法:sort[OPTION]...[FILE]...sort[OPTION]...--files0-from=F选项:-b--ignore-leading-blanks忽略最前面的空格-f--ignore-casefoldlowe

Linux命令之awk命令使用介绍 介绍:awk主要处理每一行的字段内的数据,默认分隔符:任意数量的空格或者任意数量的tab用法:awk'模式操作'file...1、awk'/正则表达式/{print...}'file...正

Linux命令之sed命令使用介绍 sed是linux轻量级流编辑器,用于行的操作,主要用来数据的选取、替换、删除、新增等。从输入文件中一次一行的读取,按顺序将列表中的命令应用到每

本文链接地址:https://www.jiuchutong.com/biancheng/364825.html 转载请保留说明!

上一篇:Linux vim删除、复制、粘贴快捷键(vim删除^m)

下一篇:Linux命令之排序命令sort使用实例(linux 排序统计)

免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

鄂ICP备2023003026号

网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

友情链接: 武汉网站建设 电脑维修 湖南楚通运网络