ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • shell command
    Linux 2024. 4. 25. 17:32

    1. Redirection

    Communication channels Redirection
    characters
    의미
    STDIN 0< 0<< 입력을 키보드가 아닌 파일을 통해받음
    STDOUT 1> 1>> 표준 출력을 터미널이아닌 파일로 출력
    STDERR 2> 2>> 표준 에러출력을 터미널이 아닌 파일로 출력

                                  * 0과 1은 생략가능

     

    1) > (Output Redirection)

     해당 파일이 이미 존재하면, >는 해당 파일을 덮어쓰고

     존재하지않으면 새로운 파일 생성

    2) >> (Appending Output Redirection)

    해당 파일이 이미 존재하면, >>는 기존 파일의 끝에 내용을 추가

     

     

    2. Pipeline

    명령의 실행결과를 다음 명령의 입력으로 전달

    기호 : command1 | command2 | command3

     

    ex) ls한 결과의 라인수

    [test@localhost ~]$ ls
    report_240514  test.sh
    [test@localhost ~]$ ls | wc -l
    2

     

    'Linux' 카테고리의 다른 글

    bash shell Rules  (0) 2024.04.25
    shell 변수  (0) 2024.04.25
    shell  (0) 2024.04.25
Designed by Tistory.