참고 사이트: opensource.com/article/18/8/introduction-pipes-linux

piping command는 마치 파이프를 연결한 것과 같다고 해서 input, output을 연결하여 command를 실행하게 된다.

> 는 화살표 방향으로 output을 넣는다는 뜻이다. 

< 는 화살표 방향으로 input을 넣는다는 뜻이다.

예시) ls -al > contents.txt ( 현재 ls -al 의 결과(output) 값을 contents.txt에 넣는다는 뜻)

예시) tail -n 2 < contents.txt ( tail command를 실행하기 위해 필요한 input값을 contents.txt 로 제공한다는 뜻)

$ cat contents.txt | grep file (contents.txt 안에서 file이라는 단어를 가진 내용을 출력한다)

+ Recent posts