brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: path: in GitHub code search limits results to the files you mean

Search
~/tips/tip-code-search-path-qualifier

"fatal error" repo:github-linguist/linguist

Cut thousands of code results down to one folder or file type.

Search GitHub for a common word and you get a pile of hits from tests, examples and docs. The path: qualifier is how I narrow it to the files I care about.

"fatal error" repo:github-linguist/linguist
timeout path:*.yml
timeout path:/src/*.js
timeout NOT path:test

A plain term after path: matches anywhere in the file path, so path:docker catches both folder and file names. Globs work: * stays within one folder level, ** crosses folders. They are not anchored by default, so add a leading slash when the match has to start at the root of the repository. NOT removes what you do not want.

For an exact file name, wrap a regular expression in slashes:

path:/(^|\/)compose\.yaml$/

That is a great way to see how other people write a certain config file.

Results do not cover every file in every repository: vendored and generated code is left out, and so are files over 350 KiB. No hit is therefore no proof that something does not exist.

Further reading: GitHub Docs: code search syntax

Going deeper: Run degoog on Unraid as your own search page, compared with SearXNG and 4get

More Search tips !!wfr Wau Holland zipgrep db_host backup.zip pdfgrep -rin "warranty" ~/Documents is:open involves:@me The <search> element replaces role="search" on a form All Search tips (11) All topics

Link