program output redirect to a file named t

root@sunny-desktop:~/Desktop# gcc test.c
root@sunny-desktop:~/Desktop# ./a.out > t 2>&1
root@sunny-desktop:~/Desktop# cat t
aafroot@sunny-desktop:~/Desktop# cat test.c
#include<stdio.h>
void main()
{
    printf("aaf");
}
root@sunny-desktop:~/Desktop#

你可能感兴趣的:(File,gcc,redirect,output)