Summary1316;1116;Ȣ16;1648;않lj16; 파1068; 'nofile.txt'1012; cat 명/161;Ǻ12;/196; 1648;1221;Ȣ16;면 1068;0152;1201;1004;/196; 아래와 같1008; 결과를 Ǻ19;lj16;다. 1593;, 실행결과와 에러를 표1456; 출/141;1109;치(/dev/tty)/196; 출/141;합니다.
[opradm@hvdev-tst-svr01 ~]$ cat nofile.txt
cat: nofile.txt: No such file or directory |
'>'lj16; 표1456;출/141;1032; FD를 변ᅆ1;
[opradm@hvdev-tst-svr01 ~]$ cat nofile.txt > /dev/null cat: nofile.txt: No such file or directory [opradm@hvdev-tst-svr01 ~]$ |
'>'lj16; '1>'와 ᇼ1;1068;Ȣ16;다.
'2>&1 > /dev/null'과 '> /dev/null 2>&1'1032; 차1060;1216;
[opradm@hvdev-tst-svr01 ~]$ cat nofile.txt 2>&1 > /dev/null cat: nofile.txt: No such file or directory [opradm@hvdev-tst-svr01 ~]$ cat nofile.txt > /dev/null 2>&1 [opradm@hvdev-tst-svr01 ~]$ |
The
&
means file descriptor1. So2>&1
redirects standard error to whatever standard output currently points at, while2>1
redirects standard error into a file called1
.Also, the redirects happen in order. So if you say
2>&1 >/dev/null
, it redirects standard error to point at what standard output currently points at (which is probably a noop), then redirects stdout to /dev/null.'> /dev/null 2>&1'1008; '&> /dev/null'와 ᇼ1;1068;Ȣ16;다.