在vi编辑器中搜索字符串并获取计数 [英] Search for string and get count in vi editor

查看:220
本文介绍了在vi编辑器中搜索字符串并获取计数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用vi编辑器搜索一个字符串并查找文件中出现的次数。

I want to search for a string and find the number of occurrences in a file using the vi editor.

推荐答案

:g/xxxx/d

模式,并报告有多少被删除。撤消以让他们返回。

This will delete all the lines with pattern, and report how many deleted. Undo to get them back after.

这篇关于在vi编辑器中搜索字符串并获取计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆