-nThe grep command shows you the line containing the term for which you're searching, but it doesn't really tell you where in the file you can find that line. To find out the line number, utilize the -n (or --line-number) option. $ grep -n pain * fiery inferno in space.txt:56:watch the paint peel, three_no_more_forever.txt:19:all alone and in pain the speed of morning.txt:66:of a Chinese painting. 8 hour a day.txt:78:nice paint job too ghost pain.txt:32:Subject: ghost pain Now that you know the line numbers for each instance of the string pain, it is a simple matter to go directly to those lines in virtually any text editor. Nice! |