dcsimg
Linux Today: Linux News On Internet Time.




More on LinuxToday


Linux.com: You've Got a Friend in Grep!

Sep 03, 2000, 23:01 (2 Talkback[s])
(Other stories by Alex Pearsall)

WEBINAR:
On-Demand

Re-Imagining Linux Platforms to Meet the Needs of Cloud Service Providers


"Ever been typing at the console, experimenting with commands? You try a command here, a command there, and jot down what you think each one does. Then, you come across one command that spurts out a long line of cool looking text, which scrolls past your terminal's viewing limit. You scroll up and down, perhaps looking for a particular string of text to tell you that your video card or network is set up properly. Wish there was an easier way? Well, there is - GREP!"

"Grep stands for (G)lobal (R)egular (E)xpression (P)arser. This information isn't really necessary, but it's a cool little fact to tell to your friends. You'll wow them with your brain power! Don't waste any mental energy trying to figure out exactly what this means, as you will probably turn red in the face and fall over. To simplify the definition, grep basically displays lines of text in a file that match the search pattern you specify. Mental gears still slipping? This analogy might help:"

"Pretend you have a screen on a window. You want to allow only ONE type of bug into your house, but leave all the rest outside. This screen allows you to customize the openings so that only the bug of YOUR choice can enter your house. Grep is like this screen. It will search the output of a command (or the contents of a file), and only show you the lines of text in that command or file that match your customized search string."

Complete Story

Related Stories: