[20190505]ts 命令在哪里.txt

--//在论坛问一下ts命令在哪里?没人解答,自己也google看了一下:
https://unix.stackexchange.com/questions/272433/piping-into-moreutils-ts-with-nanosecond-precision

--//however, if I use the same format string with moreutils' ts, the nanosecond precision fails:

--//应该在1个moreutils包里面.
--//另外注意有如下都不是:

#  ls -l ts-0.7.3-1.2.x86_64.rpm task-spooler-1.0-1.3.el6.x86_64.rpm
-rw-r--r-- 1 root root 40628 2019-05-05 16:02:38 task-spooler-1.0-1.3.el6.x86_64.rpm
-rw-r--r-- 1 root root 46792 2019-05-05 09:18:37 ts-0.7.3-1.2.x86_64.rpm

--//找到半天仅仅找到rhel 7 的rpm包.
http://rpm.pbone.net/index.php3/stat/4/idpl/55075202/dir/centos_7/com/moreutils-0.49-2.el7.x86_64.rpm.html

# ls -l moreutils-0.49-2.el7.x86_64.rpm perl-*
-rw-r--r--. 1 root root  77156 2019-05-05 16:16:44 moreutils-0.49-2.el7.x86_64.rpm
-rw-r--r--. 1 root root  39464 2019-05-05 16:27:12 perl-IO-1.25-2.2.x86_64.rpm
-rw-r--r--. 1 root root  42580 2019-05-05 16:31:03 perl-IO-Tty-1.10-11.el7.x86_64.rpm
-rw-r--r--. 1 root root 124524 2019-05-05 16:21:30 perl-IPC-Run-0.92-2.el7.noarch.rpm
-rw-r--r--. 1 root root  52744 2019-05-05 16:23:37 perl-TimeDate-2.30-2.el7.noarch.rpm
-rw-r--r--. 1 root root  16872 2019-05-05 16:21:37 perl-Time-Duration-1.06-17.8.noarch.rpm

# rpm -ivh moreutils-0.49-2.el7.x86_64.rpm perl-IPC-Run-0.92-2.el7.noarch.rpm perl-TimeDate-2.30-2.el7.noarch.rpm perl-Time-Duration-1.06-17.8.noarch.rpm perl-IO-Tty-1.10-11.el7.x86_64.rpm
warning: moreutils-0.49-2.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 9dbd524d: NOKEY
warning: perl-IPC-Run-0.92-2.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:perl-IO-Tty-1.10-11.el7          ################################# [ 20%]
   2:perl-IPC-Run-0.92-2.el7          ################################# [ 40%]
   3:perl-Time-Duration-1.06-17.8     ################################# [ 60%]
   4:perl-TimeDate-1:2.30-2.el7       ################################# [ 80%]
   5:moreutils-0.49-2.el7             ################################# [100%]

# file /usr/bin/ts
/usr/bin/ts: Perl script, ASCII text executable

# yes | ts | uniq -c
  18069 May 05 16:32:23 y
  72879 May 05 16:32:24 y
  50330 May 05 16:32:25 y
  50756 May 05 16:32:26 y
  67530 May 05 16:32:27 y
  59702 May 05 16:32:28 y
  74953 May 05 16:32:29 y

# ping -i 2 -c 3 192.168.100.40|ts  '%Y-%m-%d %H:%M:%.S'
2019-05-05 16:35:51.603349 PING 192.168.100.40 (192.168.100.40) 56(84) bytes of data.
2019-05-05 16:35:51.603458 64 bytes from 192.168.100.40: icmp_seq=1 ttl=63 time=0.502 ms
2019-05-05 16:35:53.581129 64 bytes from 192.168.100.40: icmp_seq=2 ttl=63 time=0.286 ms
2019-05-05 16:35:55.581410 64 bytes from 192.168.100.40: icmp_seq=3 ttl=63 time=0.279 ms
2019-05-05 16:35:55.581510
2019-05-05 16:35:55.581531 --- 192.168.100.40 ping statistics ---
2019-05-05 16:35:55.581548 3 packets transmitted, 3 received, 0% packet loss, time 4000ms
2019-05-05 16:35:55.581565 rtt min/avg/max/mdev = 0.279/0.355/0.502/0.105 ms

--//%.S显示秒后面的时间.精度更高.

# ping -i 1 -c 4 192.168.100.40|ts -i  '%.S'
00.000020 PING 192.168.100.40 (192.168.100.40) 56(84) bytes of data.
00.000083 64 bytes from 192.168.100.40: icmp_seq=1 ttl=63 time=0.489 ms
00.978879 64 bytes from 192.168.100.40: icmp_seq=2 ttl=63 time=0.335 ms
00.999936 64 bytes from 192.168.100.40: icmp_seq=3 ttl=63 time=0.280 ms
01.000335 64 bytes from 192.168.100.40: icmp_seq=4 ttl=63 time=0.313 ms
00.000073
00.000010 --- 192.168.100.40 ping statistics ---
00.000007 4 packets transmitted, 4 received, 0% packet loss, time 3000ms
00.000008 rtt min/avg/max/mdev = 0.280/0.354/0.489/0.081 ms

--//里面还有1些小工具.其中vidir有点恐怖有意思,可以实现像文本编辑器那样修改文件以及目录:

# man vidir
VIDIR(1)                                                                                                                                                                                                                                                        VIDIR(1)

NAME
       vidir - edit directory

SYNOPSIS
       vidir [--verbose] [directory|file|-] ...

DESCRIPTION
       vidir allows editing of the contents of a directory in a text editor. If no directory is specified, the current
       directory is edited.

When editing a directory, each item in the directory will appear on its own numbered line. These numbers are how
       vidir keeps track of what items are changed. Delete lines to remove files from the directory, or edit filenames
       to rename files. You can also switch pairs of numbers to swap filenames.

Note that if "-" is specified as the directory to edit, it reads a list of filenames from stdin and displays
       those for editing. Alternatively, a list of files can be specified on the command line.

--//演示如下:
# ls -l
total 0
-rw-r--r--. 1 root root 0 2019-05-05 16:48:29 aaa
-rw-r--r--. 1 root root 0 2019-05-05 16:48:32 bbb
drwxr-xr-x. 2 root root 6 2019-05-05 16:48:37 ccc

# vidir
1       ./aaa
2       ./bbb
3       ./ccc

--//修改如下保存,注意前面的编号不要修改:
1       ./aaa1
2       ./bbb2
3       ./ccc3

# ls -l
total 0
-rw-r--r--. 1 root root 0 2019-05-05 16:48:29 aaa1
-rw-r--r--. 1 root root 0 2019-05-05 16:48:32 bbb2
drwxr-xr-x. 2 root root 6 2019-05-05 16:48:37 ccc3

--//如果你删除了一行,对应的文件在保存后就删除了.当然我的测试如果目录非空好像不会删除.会报目录非空.

[20190505]ts 命令在哪里.txt的更多相关文章

  1. [20171205]uniq命令的输入输出.txt

    [20171205]uniq命令的输入输出.txt --//前几天遇到XXD与通配符问题,链接http://blog.itpub.net/267265/viewspace-2147702/--//今天 ...

  2. [20191119]探究ipcs命令输出2.txt

    [20191119]探究ipcs命令输出2.txt --//继续上午的测试:http://blog.itpub.net/267265/viewspace-2664758/=>[20191119] ...

  3. Linux命令: touch tem.txt创建txt文件

    touch tem.txt 创建txt文件

  4. bay——巡检RAC命令_版本.txt

    df -lhhostnamecat /etc/hostsifconfig ps -ef | grep tnsps -ef | grep asmps -ef | grep ora_ ls -l /dev ...

  5. 如何将cmd中命令输出保存为TXT文本文件

    在使用Windows 中的cmd.exe工具时,有时候我们想要把我们的输入命令及结果保存起来, 但是用复制的方法过于麻烦:有时输出数据条数过大,会造成内容自动滚出屏幕,无法阅读,我们可将命令运行的结果 ...

  6. 深入理解pandas读取excel,txt,csv文件等命令

    pandas读取文件官方提供的文档 在使用pandas读取文件之前,必备的内容,必然属于官方文档,官方文档查阅地址 http://pandas.pydata.org/pandas-docs/versi ...

  7. [20190502]给显示输出加入时间戳.txt

    [20190502]给显示输出加入时间戳.txt --//有别人问我执行脚本中timestamp.pl的代码,实际上有些文章里面有源代码,有一些忘记写上了.--//贴上:$ cat /usr/loca ...

  8. Linux常用命令awk

    awk能够处理类似csv这种按行格式的数据,对每一行record按照-F指定的分隔符切割,然后处理.默认支持空格和\t分隔符 1.统计文件里某一列数据等于某个值的个数 -0_djt10.txt 2.拼 ...

  9. 11 个很少人知道但很有用的 Linux 命令

    Linux命令行吸引了大多数Linux爱好者.一个正常的Linux用户一般掌握大约50-60个命令来处理每日的任务.Linux命令和它们的转换对于Linux用户.Shell脚本程序员和管理员来说是最有 ...

随机推荐

  1. [Linux] deepin系统添加PHP仓库源出错Error: could not find a distribution template for Deepin/stable

    aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Deepi ...

  2. python工具-将视频按帧截取图片(附代码)

    描述:将一个视频流按帧数截取大量的图片 用途:AI的数据集制作,得到大量的图片,之后将其打标签 更改的地方 1.default--间隔的帧数   2.input/output--输入视频的路径.存放截 ...

  3. miniapp之登录、授权和支付

    微信小程序代码实现(登录.授权和支付) ==整体流程看上一篇博客,或者去微信公众平台查看文档== ==只列出核心代码,详细代码见码云michaelben== 登录 // //小程序端 // app.j ...

  4. 洛谷 P5594 【XR-4】模拟赛

    洛谷 P5594 [XR-4]模拟赛 洛谷传送门 题目描述 X 校正在进行 CSP 前的校内集训. 一共有 nn 名 OIer 参与这次集训,教练为他们精心准备了 mm 套模拟赛题. 然而,每名 OI ...

  5. thinkphp的运行

    打开cmd切换到www目录下运行think E:\wamp64\www>php think run ThinkPHP Development server is started On <h ...

  6. Paper | Compression artifacts reduction by a deep convolutional network

    目录 1. 故事 2. 方法 3. 实验 这是继SRCNN(超分辨)之后,作者将CNN的战火又烧到了去压缩失真上.我们看看这篇文章有什么至今仍有启发的故事. 贡献: ARCNN. 讨论了low-lev ...

  7. 【新特性速递】树控件结构由单层 TR 改为 TR-TD-TABLE 层级嵌套

    FineUIPro/Mvc/Core的下个版本(v6.1.0),我们对树控件进行了优化,由原来的单层 TR 改为 TR-TD-TABLE 层级嵌套,从而做到表里如一. 上个版本(v6.0.0),我们对 ...

  8. JAVA学习知识杂烩

    idea快捷键使用:https://blog.csdn.net/youanyyou/article/details/97072410 int值类型与引用类型比较的坑:https://www.cnblo ...

  9. 记录下github 与 gitee 同时使用

    参考 Gitee(码云).Github同时配置ssh key 中间有一步,创建config文件,然后测试就过不去了. 报错:Bad owner or permissions on C:\\Users\ ...

  10. 动手学深度学习14- pytorch Dropout 实现与原理

    方法 从零开始实现 定义模型参数 网络 评估函数 优化方法 定义损失函数 数据提取与训练评估 pytorch简洁实现 小结 针对深度学习中的过拟合问题,通常使用丢弃法(dropout),丢弃法有很多的 ...