Grep: A Powerful Search Tool

posted: Thursday 19 November 2009 by Tavis J. Hampton in: Web Hosting VPS & Dedicated Software

Grep command on a toilet

Grep is a powerful Linux tool that can make finding things much easier. If you have SSH access to your server and need to find something lost in your big mess of files, grep can help. A simple way to use grep is:

grep "modern" /home/user/public_html/podcasts.opml

This command will search for the word “modern” in the podcasts.opml file and print any lines that contain it.

Grep can also be appended to other commands to narrow down lists. For example, you can list every file in your /usr/bin directory but single out commands that contain the word “make”:

ls -al /usr/bin | grep make

You can even use it with the ps command to read information about a particular process:

ps aux | grep httpd

This post only scratches the surface of grep’s power. To learn more about grep, type “man grep” from the command line.

Photo Source: Flickr

1 stelle2 stelle3 stelle4 stelle5 stelle (no votes)
share this 0 comments

Related posts

Server OS Tips del 30 Jul 2010
Server Backup Tips del 30 Jul 2010
Server Hardware Tips del 28 Jul 2010
Server Maintenance Tips del 28 Jul 2010

Related tags

Be the first to add a comment to this article.

Your email address is required but won't be displayed.
Leave a comment

Register to reserve your nickname accross all the blogs in the Blogo network and to upload your avatar. If you already are registered, login to user your nickname.

Yes No

Comment preview

Network Blogo