加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

VIM日志查找结果排序

发布时间:2020-12-15 16:27:35 所属栏目:安全 来源:网络整理
导读:经常需要对程序运行产生的日志中某些时间进行排序 VIM内部使用 Rgrep 命令得到 时间开销结果往往是这样的 cw打开查找窗口后: temp.log|112 col 1| something_cost_time: 8.08ms temp.log|113 col 1| something_cost_time: 8.18ms temp.log|114 col 1| somet

经常需要对程序运行产生的日志中某些时间进行排序

VIM内部使用 Rgrep 命令得到 时间开销结果往往是这样的
cw打开查找窗口后:

temp.log|112 col 1| something_cost_time: 8.08ms
temp.log|113 col 1| something_cost_time: 8.18ms
temp.log|114 col 1| something_cost_time: 8.08ms
temp.log|119 col 1| something_cost_time: 8.28ms

想按最后一列排序
使用命令
%!sort -n -k 6

%表示全部范围
! 表示在VIM中使用外部命令
-n 表示数值排序
-k 表示第某列
-t 后面可以接 分隔符,默认空格

注意一个问题: 查找结果显示窗口通过不可修改,因此先使用命令
:set ma 更改属性为可修改

本文链接
http://www.52php.cn/article/p-toxkaihh-bph.html

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读