본문 바로가기

프로그래밍 기술 노트/Linux | WSL

[Linux] 모니터링을 위한 watch 명령어

기초적인 명령어인데 최근까지 몰랏다...

watch 예시, 클릭해야 정상적으로 보인다 (GIF 도 제대로 지원안되는 tistroy)

 watch -h

Usage:
 watch [options] command

Options:
  -b, --beep             beep if command has a non-zero exit
  -c, --color            interpret ANSI color and style sequences
  -d, --differences[=<permanent>]
                         highlight changes between updates
  -e, --errexit          exit if command has a non-zero exit
  -g, --chgexit          exit when output from command changes
  -n, --interval <secs>  seconds to wait between updates
  -p, --precise          attempt run command in precise intervals
  -t, --no-title         turn off header
  -x, --exec             pass command to exec instead of "sh -c"

 -h, --help     display this help and exit
 -v, --version  output version information and exit

For more details see watch(1).

 

리눅스 command를 실시간(?) 으로 확인할수있다.

예를들어 ls 명령어로 해당 폴더에 있는 파일/폴더를 볼수있다.

ls 명령어로 나오는 결과를 실시간(?) 으로 모니터링하려면

watch ls 명령어를 치면된다.

watch ls -al 하면 당연히 ls -al 에 대한 결과를 실시간(?) 으로 모니터링할수있다.

 

728x90