grep的用法

    xiaoxiao2023-11-13  150

    grep的用法

    1、名称 grep,egrep,fgrep-print lines matching a pattern 打印与模式匹配的行 2、概要

    grep [options] pattern [file...] grep [options] [-e pattern | -f file] [file...]

    3、描述 grep 搜索指定的输入文件(如果没有指定文件,或者只给出一个连字符作为文件名,则搜索标准输入),查找包含与给定模式匹配的行。默认情况下,grep打印匹配的行。此外,有两个变体命令egrep和fgrep可用,egrep与grep -E是一样的,fgrep等于grep -F。不建议直接使用egrep和fgrep。 4、选项

    匹配控制 -v 反转匹配 -i 忽略大小写 -w 字符,字符包括字母、数字和下划线 -x 与整行完全匹配
    最新回复(0)