Centos之字符串搜索命令grep
来源:互联网 发布:刚开网店卖软件好不好 编辑:程序博客网 时间:2024/05/18 01:41
grep [选项] 字符串 文件名
在文件当中匹配符合条件的字符串
选项:
-i 忽略大小写
-v 排除指定字符串
[root@localhost ~]# grep "work" anaconda-ks.cfg
# Network information
network --bootproto=dhcp --device=ens33 --onboot=off --ipv6=auto --no-activate
network --hostname=localhost.localdomain
[root@localhost ~]#
我们可以找到anaconda-ks.cfg 文件中含有"work"字符串的行
[root@localhost ~]# grep -v "work" anaconda-ks.cfg
#version=DEVEL
#sdfsddsd
System authorization information
auth --enableshadow --passalgo=sha512
# Use CDROM installation media
cdrom
# Use graphical install
graphical
# Run the Setup Agent on first boot
firstboot --enable
# Keyboard layouts
keyboard --vckeymap=cn --xlayouts='cn'
# System language
lang zh_CN.UTF-8
# Root password
rootpw --iscrypted $6$G7eVijyXAp8DMSXi$bKh/vjEbEdH.4WmgXjhpw08/jYzjGDgaTnc8ZNFfUREgFX0Kepz39OwQsjhlFBaYUPwUUuI.RcsCAgkqrWeSJ1
# System services
services --disabled="chronyd"
# System timezone
timezone Asia/Shanghai --isUtc --nontp
# System bootloader configuration
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda
autopart --type=lvm
# Partition clearing information
clearpart --none --initlabel
%packages
@^minimal
@core
kexec-tools
%end
%addon com_redhat_kdump --enable --reserve-mb='auto'
%end
%anaconda
pwpolicy root --minlen=6 --minquality=50 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=50 --notstrict --nochanges --notempty
pwpolicy luks --minlen=6 --minquality=50 --notstrict --nochanges --notempty
%end
[root@localhost ~]#
加了 -v 就查找不包含"work"的行;
- Centos之字符串搜索命令grep
- grep 搜索字符串命令
- grep 搜索字符串命令
- 字符串搜索命令grep
- 字符串搜索命令 grep
- grep命令,centos 搜索文件
- Linux 字符串搜索命令 grep
- linux之grep搜索字符串
- linux 文件中搜索字符串命令 grep
- linux 文件中搜索字符串命令 grep
- linux 文件中搜索字符串命令 grep
- linux 文件中搜索字符串命令 grep
- linux中grep字符串搜索命令
- Linux学习笔记--grep命令(搜索字符串命令)
- 【Linux学习笔记】9:字符串搜索命令grep
- 文件搜索命令grep
- grep之字符串搜索算法Boyer-Moore由浅入深
- grep之字符串搜索算法Boyer-Moore由浅入深
- IntelliJ IDEA 中 右键新建(new)时,选项没有scala(java) class的解决方法和具体解释
- 顺时针打印矩阵
- 英语六级词汇总结(此文持续更新)
- 自定义View(二-番外1)
- JDBC学习笔记(MySQL)
- Centos之字符串搜索命令grep
- 后端开发--Http协议(3):Get与Post方法的比较
- centos7配置javaweb环境
- 性能调优攻略
- 常用布局效果05-导航菜单布局
- Matlab实现文件读写的几种方法
- 【云星数据---Apache Flink实战系列(精品版)】:Apache Flink高级特性与高级应用008-Slot和Parallelism的深入分析003
- HDU
- diskpart clean命令清空分区表后的数据恢复