Search This Blog

Saturday, October 26, 2019

GREP COMMANDS

GREP COMMANDS
To search the pattern in a particular file
  • grep "Nagaraju" filename.txt
To search a pattern without case insensitive
  • grep -wi "nagaraju" filename.txt
To search a pattern before and after the 10  lines
  • grep -win -A/B/C 10 "Nagaraju"   filename.txt
To display all file names which contains the searched pattern
  • grep -win "Nagaraju"  ./* 
To display other than that the searched pattern
  • grep   -v "Nagaraju" filename.txt
  • grep   -vE  "pattern1|pattern2" filename.txt
Displaying the count of the number of matches
  • grep  -c "Nagaraju"  filename.txt  
To check for the whole words in a file
  • grep -w "Nagaraju" filename.txt
To show the line numbers of the matched pattern
  • grep -n "Nagaraju" filename.txt
To Display the matched pattern
  • grep -o "Nagaraju"  filename.txt
To display the matching pattern that starts/ends with a string
  • grep "^Nagaraju" filename.txt
  • grep "Nagaraju$" filename.txt
How to grep multiple 
  • grep -E "Naga|Raju" filename.txt








No comments:

Post a Comment

What is the sanity checks you have done for STA?

 Sanity checks for STA: Linking Checks: We need to check., is there any missing modules or missing pins in a library. this is done by link c...