Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ grep command Series: grep command to search for multiple words     - Oracle 10g after the failure to start the upgrade (Oracle instance terminated. Disconnection forced) (Database)

- Oracle GoldenGate Installation and Configuration Tutorial Introduction (Database)

- Linux excellent text editor (Markdown, LaTeX, MathJax) (Linux)

- SUSE Firewall Configuration (Linux)

- Encrypted with GnuPG signature to verify the authenticity and integrity of downloaded file (Linux)

- jdbc Oracle database connection string writing pluggable (Database)

- Linux Defensive / mitigate DDOS attacks (Linux)

- Unsafe reboot start (Linux)

- Ubuntu 12.04 installation NVIDIA GTX750 graphics driver (Linux)

- Lazarus for Raspbian installation (Linux)

- Java Set and List in the relationship and difference (Programming)

- Linux Troubleshooting: How to save the status of the SSH session is closed (Linux)

- Use pg_basebackup build PostgreSQL streaming replication environment (Database)

- To build PHP environment (Nginx + MariaDB + PHP7) under CentOS 6.5 (Server)

- Inject script commands manually annotated summary (Linux)

- Linux system security settings after installation (Linux)

- CentOS7 management of systemd (Linux)

- 30 minutes with your Quick Start MySQL Tutorial (Database)

- Ubuntu 15.10 under Python + Apache + CGI fully configured (Server)

- Summary Linux operating system some tips to prevent attacks (Linux)

 
         
  grep command Series: grep command to search for multiple words
     
  Add Date : 2018-11-21      
         
         
         
  To use the grep command to search for multiple strings or words, how do we do? For example, I want to find / path / to / file file word1, word2, word3 and other words, how do I look like grep command these words are there?

grep command supports regular expression pattern matching. To use multi-word search, please use the following syntax:

grep 'word1 \ | word2 \ | word3 ' / path / to / file
Under the example, to find a name in / var / log / messages log file in a text warning, error and critical these few words, enter:

$ Grep 'warning \ | error \ | critical ' / var / log / messages
Just to match the word (that is, both sides of the word is a word delimiter, separated by spaces for the West in terms of language), you can add -w option parameter:

$ Grep -w 'warning \ | error \ | critical ' / var / log / messages
egrep command can skip the above syntax, the use of syntax is as follows:

$ Egrep -w 'warning | error | critical ' / var / log / messages
I built the righteous of you add -i (ignore case) and --color option parameters, as shown here:

$ Egrep -wi --color 'warning | error | critical' / var / log / messages

Fig.01: Linux / Unix egrep Command Search Multiple Words Demo Output
     
         
         
         
  More:      
 
- CentOS 6 Install Linux kernel source (Linux)
- You may not know the Linux command-line network monitoring tool (Linux)
- Linux console password solution (Programming)
- Linux - EXT2 file system is described in detail (Linux)
- To setup Cocos2dx project under Ubuntu (Linux)
- Eclipse distributed management using GitHub project development (Linux)
- Linux port mapping system (routing and forwarding) (Server)
- Kali Linux 2.0 U disk installation errors Your installation cd-rom could not be mounted (Linux)
- CentOS 6.5 x86_64 system customized automated deployment (Linux)
- MySQL Data Types (Database)
- Ubuntu security settings and tools (Linux)
- CentOS 7 Change Hostname (Linux)
- Linux Change ssh port and disable remote root login at (Linux)
- Type Linux commands (Linux)
- Oracle 11g modify MEMORY_TARGET (Database)
- Elaborate .NET Multithreading: Thread Pool (Programming)
- Ubuntu 10.10 install Oracle 10g Installation Guide (Database)
- How to install Zephyr Test Management Tools on CentOS 7.x (Server)
- MySQL to manage multiple instances of method (Database)
- Oracle user lock how to know what causes (Database)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.