Linux grep command operation guide ① defines www.2cto.com grep as a row-level device, which analyzes a line of information. If there is any information we need, it will return the whole line ② for the comparison of string data, print the string that meets your needs. ③ format: grep [-acinv] [-- color = auto] '. Find the string 'filename'. Parameter:-: search data using a text file in binary files-c: count the number of times the 'query string' is found-I: case-sensitive transparent-n: Output row number-v: show the row-A without the 'search string' content-A: Followed by A number, which means after. In addition to listing the row, the subsequent n rows are also listed-B: numbers can be added to the end, which means before. In addition to listing this row, the previous n rows are also listed -- color = auto: color of the keyword ④ example www.2cto.com eg01: find the flag of a checkpoint event [SQL] [oracle @ localhost bdump] $ grep-in -- color = auto 'checkpoint' alert_orcl.log 64: checkpoint is 446074 66: checkpoint is 446074 69: checkpoint is 446074 72: checkpoint is 446074 383: checkpoint is 460200 1845: Checkpoint not complete 2112: checkpoint is 606217 2114: checkpoint is 606217 2116: checkpoint is 606217 2118: checkpoint is 606217: checkpoint is 606217 eg02: find information about the NIC from the kernel [SQL] [oracle @ localhost bdump] $ dmesg | grep-n-A3-B2 -- color = auto 'eth '599-iscsi: registered transport (iser) 600-iscsi: registered transport (be2iscsi) 601: eth0: no IPv6 routers present 602-Bluetooth: Core ver 2.10 603-NET: Registered protocol family 31 604-Bluetooth: HCI device and connection manager initialized -- 615-ip_conntrack version 2.4 (8192 buckets, 65536 max)-228 bytes per conntrack 616-ip6_tables: (C) 2000-2006 Netfilter Core Team 617: peth0: promiscuous mode enabled. 618: device peth0 entered promiscuous mode 619: xenbr0: port 1 (peth0) entering forwarding state 620-device vif0.0 entered promiscuous mode 621-New device vif0.0 does not support netpoll 622-Disabling netpoll for xenbr0 -- 625-hdc: drive_cmd: error = 0x04 {AbortedCommand} restart: failed opcode was: 0xec 627: eth0: no IPv6 routers present 628: xenbr0: port 1 (peth0) entering disabled state 629: xenbr0: port 1 (peth0) entering forwarding state