Skip to content Accesskey=4Skip to sub-navigation Accesskey=3View our Accessibility Options MIT Information Systems Home About IS&T Contact IS&T Site Map Search Advanced Search
Getting StartedGetting Services by Topic or Alphabetically Getting Help

On This Page

[Help]

  

Quick Links

Top Level

Related Links

Ask OLC a question

Athena Consulting Homepage

Helpdesk Stock Answers (for Mac/PC questions)


Shell commands and PIPELINES

A simple command is a sequence of words, the first of which specifies the
command to be executed.  A simple command or a sequence of simple commands
separated by '|' characters forms a "pipeline".  The output of each command in
a pipeline is connected to the input of the next.  Sequences of pipelines may
be separated by ';', and are then executed sequentially.  A sequence of
pipelines may be executed without immediately waiting for it to terminate by
following it with an '&'.

Some common examples:

	show | lpr -Pprintername        	(print current message)	
	scan +inbox | more                      (page through inbox listing)
	man ls | lpr -Pprintername		(print the 'ls' manual page)
	ls -l | fgrep a.out	        	(list all a.out files)
	
Any of the above may be placed in parentheses form a simple command (which may
be a component of a pipeline, etc.). It is also possible to separate pipelines
with '||' or '&&', indicating, as in the C language, that the second is to be
executed only if the first fails or succeeds respectively.

MIT Home | Getting Started | Getting Services | Getting Help | About IS&T | Accessibility
Ask a technology question or send a comment about this web page.