Neat grep intro (??) has a good article up on the powerful grep command. GREP is one of the most useful command line tools in linux (really, there are so many it’s hard to choose, but this is one I use more frequently than most others…) grep can stand on it’s own to look for a term in many files (for example)

grep soughtafterterm *.txt

it will display which line numbers and which files it appears in.

It can do more sophisticated searches though, accept command output from standard in… etc. (ls | grep filename) is one I do a fair amount. If you get the hang of grep you’ll start to get an idea of why people think storing documents in some sort of text readable format is a good idea (think xml…).

A little off topic… but… I once had someone ask why xml file formats were such a big deal. I told them that for the average user it may not be, but there are many great and flexible ways to search through plain text readable files. (Or manipulate plain text readable files.) Not to mention the ability to salvage your plain text if the word processing program is no longer supported.

   Send article as PDF   

Similar Posts