Linuxgrep command operation guide

Source: Internet
Author: User
Linuxgrep command operation guide ① defines www.2cto. comgrep is a row-level device that analyzes a row of information. if there is any information we need, the whole row will be returned ② for the comparison of string data, print the string that meets your needs in the ③ format... information & nb
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
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.