ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [Shell] which : 쉘 명령어 및 프로그램의 Path 경로를 확인하는 명령어
    Shell & CMD/명령어 리스트 2021. 11. 21. 12:03
    반응형

    cd, ls pwd 와 같은 기본 쉘 명령어 외 프로그램의 경로를 확인하는데 사용하는 명령어.

     

    [사용예제]

    shell {명령어}

     

    -a 옵션을 주면 su 유저권한도 확인할 수 있다.

    which -a {명령어}

     

    su 유저에 없으면 안나올 수 있다.

     

    한줄에 여러 명령어를 확인해 볼 수 있다.

     

    [도움말]

    Usage: /usr/bin/which [options] [--] COMMAND [...]
    Write the full path of COMMAND(s) to standard output.
    
      --version, -[vV] Print version and exit successfully.
      --help,          Print this help and exit successfully.
      --skip-dot       Skip directories in PATH that start with a dot.
      --skip-tilde     Skip directories in PATH that start with a tilde.
      --show-dot       Don't expand a dot to current directory in output.
      --show-tilde     Output a tilde for HOME directory for non-root.
      --tty-only       Stop processing options on the right if not on tty.
      --all, -a        Print all matches in PATH, not just the first
      --read-alias, -i Read list of aliases from stdin.
      --skip-alias     Ignore option --read-alias; don't read stdin.
      --read-functions Read shell functions from stdin.
      --skip-functions Ignore option --read-functions; don't read stdin.
    
    Recommended use is to write the output of (alias; declare -f) to standard
    input, so that which can show aliases and shell functions. See which(1) for
    examples.
    
    If the options --read-alias and/or --read-functions are specified then the
    output can be a full alias or function definition, optionally followed by
    the full path of each command used inside of those.
    
    Report bugs to <which-bugs@gnu.org>.
    반응형

    댓글

Designed by Tistory.