Here is few grep command which is frequently used to do many operation in unix.

Home › Forums › Grep Unix Command. › Here is few grep command which is frequently used to do many operation in unix.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #2076
    Admin
    Keymaster

    grep stands for global search for regular expression and print out.

    Syntax:
    grep [options] pattern [files]

    1. Case in sensitive search in grep.
    command : grep -i “appLE” fruitname.txt

    explanation: option -i is enable the case sensitive search, above is the “appLE” will search on apple,Apple, APPLE, appLE and APPle.

    2. Count of number of match.
    command: grep -c “appLE” fruitname.txt

    result :2

    3. validate whole word.
    command: grep -w “apple” fruitname.txt

    4. display the line number
    command: grep -n “apple” fruitname.txt

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
Netflixโ€™s Overall Architecture. Gold is money every thing else is credit