#TIL #windows #cmd shell에서 실행한 명령 출력을 보기 싫을 때

출력 자체를 막을 순 없고 null 디바이스에 리다이렉션(redirection)해서 출력을 감춘다.

C:\> command >nul

stdout만 보기 싫을 때.

C:\> command >nul 2>&1

stdout, stderr 둘 다 보기 싫을 때.

>nul 명령은 1>nul 명령과 같다. 그래서 stderr 출력을 2>&1 명령으로 stdout으로 리다이렉션해서 둘 다 감춘다. bash shell에서는 nul 대신 /dev/null 사용.

Feedback plz <3 @ohyecloudy, ohyecloudy@gmail.com

A Random Post