Skip to content

Inotifywait

특정 파일/디렉토리 감시

Simple Usage

# inotify-tools 설치 / Install inotify-tools
sudo apt install inotify-tools

# 특정 디렉토리 내 모든 파일 접근 감시 / Watch all file access in a directory
inotifywait -m -r /path/to/dir -e open,close,access,modify

# 특정 파일 하나만 감시 / Watch a single file
inotifywait -m /etc/passwd -e open,close

See also

  • lsof
  • fuser
  • strace
  • fuser - 특정 파일/포트를 사용 중인 프로세스 찾기
  • bpftrace/bcc - 오버헤드 최소, 프로덕션 환경 적합
  • auditd - 시스템 레벨 감사 로그 (영구 설정 가능)