Redirecting Command-Line Output to Files

When using the command line, you can redirect standard output and standard error to a file. This avoids displaying a lot of text, which will slow down execution; scrolling text in a terminal window on a workstation can cause an I/O bottleneck (increased elapsed time) and use more CPU time.

Linux* OS and Mac OS* X:

The following example applies to Linux* OS and Mac OS* X.

To run the program more efficiently, redirect output to a file and then display the program output:

myprog > results.lis
more results.lis

Windows* OS:

The following examples apply to Windows OS.

To place standard output into file one.out and standard error into file two.out, use the ifort command as follows:

ifort filenames /options 1>one.out 2>two.out

You can also use a short-cut form (omit the 1):

ifort filenames /options >one.out 2>two.out

To place standard output and standard error into a single file both.out, enter the ifort command as follows:

ifort filenames /options 1>both.out 2>&1

You can also use a short-cut form (omit the 1):

ifort filenames /options >both.out 2>&1

Submit feedback on this help topic

Copyright © 1996-2010, Intel Corporation. All rights reserved.