ITPub博客

首页 > 自动化运维 > 应用服务器 > [20200313]windows显示输出时间戳脚本.txt

[20200313]windows显示输出时间戳脚本.txt

原创 应用服务器 作者:lfree 时间:2020-03-13 09:06:17 0 删除 编辑

[20200313]windows显示输出时间戳脚本.txt

--//前几天为了实现windows下显示输出时间戳脚本,居然浪费半个小时,还是做一个记录,便于以后查找.
--//批处理 ts.bat脚本如下,注意安装gawk,可以安装UnxUtils包。,主要前面要加@echo off.
--//里面的" 前面要加\转义.
@echo off
gawk "{ print strftime(\"[%%Y-%%m-%%d %%H:%%M:%%S]\"), $0 }"

--//测试:
D:\>dir /b | ts | head -3
[2020-03-12 16:18:06] My Documents
[2020-03-12 16:18:06] Program Files
[2020-03-12 16:18:06] download


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/267265/viewspace-2679944/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
熟悉oracle相关技术,擅长sql优化,rman备份与恢复,熟悉linux shell编程。

注册时间:2008-01-03

  • 博文量
    4006
  • 访问量
    7970751