【Linux】grep的简单用法
来源:互联网 发布:全新英朗刷启停软件 编辑:程序博客网 时间:2024/03/29 19:12
[root@www ~]# grep [-acinv] [--color=auto] '搜寻字符串' filename选项与参数:-a :将 binary 文件以 text 文件的方式搜寻数据-c :计算找到 '搜寻字符串' 的次数-i :忽略大小写的不同,所以大小写视为相同-n :顺便输出行号-v :反向选择,亦即显示出没有 '搜寻字符串' 内容的那一行!--color=auto :可以将找到的关键词部分加上颜色的显示喔!范例一:将 last 当中,有出现 root 的那一行就取出来;[root@www ~]# last | grep 'root'范例二:与范例一相反,只要没有 root 的就取出![root@www ~]# last | grep -v 'root'范例三:在 last 的输出信息中,只要有 root 就取出,并且仅取第一栏[root@www ~]# last | grep 'root' |cut -d ' ' -f1# 在取出 root 之后,利用上个命令 cut 的处理,就能够仅取得第一栏啰!
http://vbird.dic.ksu.edu.tw/linux_basic/0320bash_6.php 0 0
- 【Linux】grep的简单用法
- Linux grep的用法
- linux grep的用法
- grep的简单的用法
- linux的find、grep用法
- linux命令--grep 的用法
- linux下的grep用法
- linux shell grep的用法
- linux grep的用法详解
- linux中grep的用法
- grep 简单用法
- grep简单用法
- linux中grep命令的用法
- linux常用命令(2)-grep的用法
- Linux下grep命令的用法
- Linux中grep命令的用法
- linux中grep命令的用法
- Linux中grep命令的用法
- 我的iOS开发之Objective-C第4天之属性、复合
- linux top命令%st值高是怎么回事
- socket编程中write、read和send、recv之间的区别
- android开发hello world之诚信版
- Android应用程序资源的编译和打包过程分析 (转自老罗的博客)
- 【Linux】grep的简单用法
- 修改u-boot的开机logo及显示过程
- Windows Android Studio 打开失败
- HTML5图片拖拽
- 1052. Linked List Sorting (25)
- mybatis--mapper映射文件配置之select,resultMap
- java反射,获得Class是否为基本数据类型,是否其他类的父类。获得泛型。
- Burp suite的安装教程
- 架构师应该掌握什么技术?