TECHIES WORLD

For Techs.... Techniques.... Technologies....

CpanelLinux

How to search lines containing numbers in Linux

We can use grep command with a regular expression to search lines containing numbers.

#grep -w '[0-9]\{n\}' filename

Here we need to replace 'n' with the number of digits that we need to search.

 

Leave a Reply