zoukankan      html  css  js  c++  java
  • pt-align的用法简要记录

    pt-align的用法简要记录

    1、pt-align
    功能:将其它工具的输出按列对齐
    用法:pt-align [FILES]
    如果没有指定文件,则默认读取标准输入的内容。

    2、例如:

    [root@dbtest tmp]# cat test.txt
    DATABASE TABLE ROWS
    foo bar 100
    long_db_name table 1
    another long_name 500
    
    [root@dbtest tmp]# pt-align test.txt
    DATABASE     TABLE     ROWS
    foo          bar        100
    long_db_name table        1
    another      long_name  500
    [root@dbtest tmp]#
    # 如,常用的vmstat的输出,阅读体验就不够人性化。
    [root@dbtest tmp]# vmstat 2 5 
    procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
     r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
     0  0      0 1911644 115760 1276920    0    0    52    57   26    6  0  0 99  0  0    
     0  0      0 1911644 115768 1276936    0    0     0    24  293  629  0  0 100  0  0    
     0  0      0 1911644 115768 1276940    0    0     0     0  336  670  0  0 100  0  0    
     0  0      0 1911644 115768 1276940    0    0     0    22  273  604  0  0 100  0  0    
     0  0      0 1911644 115768 1276940    0    0     0     0  366  685  0  0 100  0  0    
    # 在这种情况下,就可以使用pt-align进行处理
    [root@dbtest tmp]# vmstat 2 5 | pt-align 
    r b swpd    free   buff   cache si so bi bo  in  cs us sy  id wa st
    2 0    0 1911612 115772 1276940  0  0 52 57  26   6  0  0  99  0  0
    0 0    0 1908892 115772 1276940  0  0  0  0 288 606  1  0  99  0  0
    0 0    0 1908768 115772 1276940  0  0  0  6 269 606  0  0  99  0  0
    0 0    0 1908768 115772 1276940  0  0  0  0 271 596  0  0 100  0  0
    0 0    0 1908768 115772 1276940  0  0  0  1 285 630  0  0 100  0  0
    [root@dbtest tmp]# 
  • 相关阅读:
    pug 基础篇
    胡里胡哨-老师改卷纸
    javaScript 原生技巧
    angular9的学习(十二)插槽
    typescript高级编程(二)
    typescript高级编程(一)
    ActiveMq 使用指北
    基于ZooKeeper的分布式锁实现
    windows下配置启动脚本并设置开机自启及相应关闭脚本
    腾讯位置服务JavaScript API GL实现文本标记的碰撞避让
  • 原文地址:https://www.cnblogs.com/bjx2020/p/11357720.html
Copyright © 2011-2022 走看看