1 of 6

Linux IO Redirection

CSE 232 - Dr. Josh Nahum

2 of 6

Reading:

No Readings

3 of 6

Redirecting I/O

|

program > x.txt

The output from the executable named program is written to the file named x.txt

program < x.txt

The input from for the executable named program is read from the file named x.txt

program | other

The output from the executable named program is redirected to be the input for the executable named other

>

<

4 of 6

Useful of testing programs!

5 of 6

Live Coding Example

6 of 6

Attribution

Dr. Joshua Nahum

www.nahum.us

EB 3504

Please ask questions via Piazza

© Michigan State University - CSE 232 - Introduction to Programming II

CREDITS: This presentation template was created by Slidesgo, and includes icons by Flaticon, and infographics & images by Freepik