본문 바로가기

Linux

[Linux] Search a specific text

grep -rnw 'path for search' -e 'string to search' \
      --include=\*.{txt,sh} --exclude-dir=dir_name

This command searches 'string to search' from the directory 'path for search', while excluding dir_name directory.

'Linux' 카테고리의 다른 글

[Ollama] Expose port  (1) 2026.04.02
[Linux] Decision to go back to macOS  (1) 2026.03.29
[Slurm] 가용 가능한 GPU 빨리 보기  (0) 2026.02.23
[Linux] ssh pem file invalid format error  (0) 2026.02.11
[Linux] Reverting to the initial GNOME  (0) 2026.02.11