안녕하세요..^
find 명령으로 파일 내용을 검색할수있을까요 궁금합니다
파일내용 검색하는 명령이 따로 있을까요?
grep이 있습니다. man grep
find에서 -exec로 grep을 부르시는 수도 있겠죠.
네 검은해님 말씀처럼,
find /path -name "*.c" -exec grep pattern {} \;
하셔도 되구요.
find /path -name "*.c" | xargs grep pattern
하셔도 됩니다.
저는 아래쪽을 선호하는 편입니다.
* code 넣느냐고 수정했습니다.[/code]
-- 종이한장 * 이성으로 비관하더라도 의지로 낙관하라! (그람시)
텍스트 포맷에 대한 자세한 정보
<code>
<blockcode>
<apache>
<applescript>
<autoconf>
<awk>
<bash>
<c>
<cpp>
<css>
<diff>
<drupal5>
<drupal6>
<gdb>
<html>
<html5>
<java>
<javascript>
<ldif>
<lua>
<make>
<mysql>
<perl>
<perl6>
<php>
<pgsql>
<proftpd>
<python>
<reg>
<spec>
<ruby>
<foo>
[foo]
grep이 있습니다. man grepfind에서 -exec로 gr
grep이 있습니다. man grep
find에서 -exec로 grep을 부르시는 수도 있겠죠.
네
네
검은해님 말씀처럼,
find /path -name "*.c" -exec grep pattern {} \;
하셔도 되구요.
find /path -name "*.c" | xargs grep pattern
하셔도 됩니다.
저는 아래쪽을 선호하는 편입니다.
* code 넣느냐고 수정했습니다.[/code]
--
종이한장 * 이성으로 비관하더라도 의지로 낙관하라! (그람시)
댓글 달기