Presentation is loading. Please wait.

Presentation is loading. Please wait.

Redirection & Pipes Understanding UNIX Input and Output.

Similar presentations


Presentation on theme: "Redirection & Pipes Understanding UNIX Input and Output."— Presentation transcript:

1 Redirection & Pipes Understanding UNIX Input and Output

2 What is Input? Information fed into a data processing system or computer (Merriam-Webster Dictionary) Data necessary to create some action or output. Text –‘Hello World’ Keystroke combinations –CTRL -D

3 Input Sources Standard Input (stdin) Device –That part of the operating system controlling from where a program receives its input. – keyboard Any defined device capable of receiving input

4 What is Output? The information produced by a computer (Merriam-Webster Dictionary) Data created as a result of some action or input. Text –‘Hello World’ Pictures & Graphics –…

5 Output Destinations Standard Output (stdout) Devices –That part of the operating system that controls where a program writes its output. –Monitor –Printer Any defined device capable of receiving output

6 What is a file? UNIX is a file based operating system –Everything is a file Say What!?

7 UNIX File Types Types of files –Directory File Contains references to other files –/dev –Regular File Text, configuration, etc. –/home/my.txt –Device Files –/dev/cdrom

8 UNIX Commands Are commands Files too Typically single “specialized” functions Commands are files that accept input and perform some operation, either –On the input directly, or # cat my.txt –As directed by the input. # ls –al /usr

9 Redirection Where? > the redirection operator –Allows for an output destination other then standard output (stdout). –Is a write only operation Can only redirect to regular files. # ls –al /usr > directory.lst

10 Pipes Keeping the Flow Going… | the pipe operator –Allows for the output (stdout) of one command to serve as the input (stdin) of another command –No write involved in the process Can only be used with commands ( executables ) # ls –al /usr/bin | grep ls -

11 Putting it All Together What do we gain –Extended functionality –Increased control –Innovative solutions –An understanding of both input and output

12 IN CLASS DEMONSTRATION SIX Volunteers able to follow instructions –Hmmmm… A paper | B | C | D | E | F > Frontdesk


Download ppt "Redirection & Pipes Understanding UNIX Input and Output."

Similar presentations


Ads by Google