O'Reilly logo

Korn Shell: Unix and Linux Programming Manual, Third Edition, The by Anatole Olczak

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Input/Output Redirection

The Korn shell provides a number of operators than can be used to manipulate command input/output and files. For example, you can save command output to a file. Or instead of typing in the input to a command, it can be taken from a file. The following sections describe some of the features of Korn shell I/O redirection.

Redirecting Standard Output

The standard output of a command is by default directed to your terminal. By using the > symbol, the standard output of a command can be redirected to a file, instead of your terminal. In this example, the standard output of the echo command is put into the file p.out:

						$ echo "Hello" > p.out
						$ cat p.out
						Hello
					

If the file doesn't exist, then it is created. Otherwise, the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required