get the first element from grep output code example
Example: grep first occurence for many matches
Just use flag -m to define number of occurrences to match:
grep -m1 pattern file
Just use flag -m to define number of occurrences to match:
grep -m1 pattern file