Search This Blog

Sunday, 5 October 2014

Grep Command

Grep Command

TO FIND THE LINE WHICH CONTAIN A PARTICULAR STRING AND OUTPUTS IT

grep GRAPH_NAME Tfr3.txt > Graph.txt

This will print THE LINEs WHICH CONTAIN the STRING “GRAPH_NAME” AND OUTPUTS IT

TO FIND THE LINE NUMBERS WHICH CONTAIN A PARTICULAR STRING

grep -n Aravind File.txt

This will display below output as the string Aravind is present in line 10

10:Aravind

No comments:

Post a Comment