grep is a command line utility for searching plain-text data for lines which matching a regular expression. If you will divide the word grep like g/re/p then the meaning of grep is (globally search a regular expression and print) which search pattern from the file and print the line on the screen i.e. standard output.

7. Search Graphical Characters

The grep is also used to search a line which will start from Alphanumeric & Punctuation Characters called as Graphical Characters.

$ grep "^[[:graph:]]" tecmint.txt

Grep – Search Graphical Characters in File

8. Search Printable Characters

Similarly like Graphical Characters, grep is useful to search a line which will start from Alphanumeric, Punctuation and space characters.

$ grep "^[[:print:]]" tecmint.txt

Grep – Search Printable Characters in File

9. Search Space Characters

The grep has also a functionality to search a line which will start from [tab, newline, vertical tab, form feed, carriage return, and space] i.e. Space Characters.

$ grep "^[[:space:]]" tecmint.txt

Grep – Search Space Characters in File

10. Search Uppercase Letters

Another option in the grep is also used to search a line which will start from [A-Z] i.e Upper-case Letters.

$ grep "^[[:upper:]]" tecmint.txt

Grep – Search Uppercase Letters in File

11. Search Hexadecimal Digits

The grep searches a line which will start from [0-9, A-F and a-f] i.e Hexadecimal Digits.

$ grep "^[[:xdigit:]]" tecmint.txt

Grep – Search Hexadecimal Digits in File

I have explained the advanced functionality of grep which is very strong and powerful tool to search the pattern in a File. Grep is also an important tool for shell scripting and programmers to search the pattern in the programs. It is worth to be familiar with other options and syntax to save the time.