command to find keyword from file

grep command to find keyword from file
# cat test
192.168.0.1
192.168.0.2
192.168.0.3

Syntax: grep “pattern”  file_name
# grep "192.168.0.1" test
192.168.0.1

Awk command to find keyword from file
Syntax: awk '/pattern/' file_name

# awk '/192.168.0.3/' test
192.168.0.3

Find Multiple keyword from file

# awk '/192.168.0.3|192.168.0.1/' test
192.168.0.1

192.168.0.3

Share on Google Plus

About Penguin Technology

I am a passionate cloud and DevOps professional specializing in Linux and open-source solutions. Through this blog, I share my knowledge and experience with the community, offering tips and insights on cloud technologies and DevOps practices.
    Blogger Comment

0 comments:

Post a Comment