파일 콘텐츠 검색
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
기본적으로 쿼리는 파일 경로와 콘텐츠를 모두 검색합니다. content
필터를 사용하여 파일의 콘텐츠만 검색하도록 제한할 수 있습니다. 예를 들어 다음 쿼리는 모든 Java 파일의 콘텐츠에서 main
이라는 용어를 찾습니다. 경로에 검색어 main
이 있는 경우는 검색하지 않습니다.
lang:java content:main
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[[["\u003cp\u003eThe default search includes both file paths and file content.\u003c/p\u003e\n"],["\u003cp\u003eFor content-only searches, use the \u003ccode\u003econtent\u003c/code\u003e filter, like \u003ccode\u003econtent:main\u003c/code\u003e to find "main" within Java files.\u003c/p\u003e\n"],["\u003cp\u003eThis approach avoids irrelevant results from file paths containing the search term.\u003c/p\u003e\n"]]],[],null,["# Searching file contents\n\nBy default, a query searches both the file path and the content. You can\nrestrict your search to just the contents of a file by using the\n[`content`](../reference#filters) filter. For example, the following query looks\nfor the term `main` in the contents of all Java files. It does not search for\ninstances where a path contains the term `main`. \n\n lang:java content:main"]]