Friday, October 13, 2006

The grep command

So far, since I first used DOS, and later Unix, there have been many commands I have used, such as dmesg, cp, ls, cat, cd, df, fsck, mount, echo, mv, mount, tar (-x -f), gzip, man, and others. However, both my and my father's favorite command is grep. The command grep is used to find strings (with)in a file. Ex. dmesg grep "fd0a", grep foo *. The first example finds the string fd0a in the system initialization test, and the second one finds "foo" in all the files in the current directory. This command was first used in AT&T's Unix, and remains in BSD-based (based on x.xBSD, Berkeley Software Distribution Unix operating systems; ex. OpenBSD, or my favorite ;), NetBSD) and in Linux. For more info, go to these pages:

Grep - Wikipedia / Wikipedia article about grep /
GNU grep / GNU's grep software /
GREP / Cool info about grep and thorough description of its usage /
UNIX man pages : grep () / Technical (sort of boring) explanation of unix grep usage /
GREP for Windows / For those of you stuck with Microsoft's bloated operating system /

All links work as of October 2006.

No comments: