SEARCH: webmonkey  the web

 


Quick Reference:

JavaScript Library
HTML Cheatsheet
Special Characters
Color Codes
Browser Chart
Stylesheet Guide
Unix Guide
Glossary
Domain Registries

Reference   Unix Guide

Combining Commands

Most Unix commands are fairly simple and only have a handful of options. The beauty of Unix is that these commands can be combined to do more complex tasks. You can send the output of one command to another command for further processing by separating the commands with a pipe (|).

If you want to follow a file as it grows (tail -f) and search for a regular expression (grep), you can combine commands to achieve this. If you are searching for files in a growing error log that contains the word supermonkey you would type this:

 tail -f errorlog | grep ".*supermonkey.*" 
This tails the errorlog and then greps for the regular expression "supermonkey." The . and * are called meta-characters. The .* in this example matches any number of any character.

Back to the index.