diff --git a/README.md b/README.md index bf8d3b2..df45bb5 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ working across different projects via [VisualMode](https://www.visualmode.dev/). For a steady stream of TILs, [sign up for my newsletter](https://visualmode.kit.com/newsletter). -_1762 TILs and counting..._ +_1763 TILs and counting..._ See some of the other learning resources I work on: @@ -1649,6 +1649,7 @@ If you've learned something here, support my efforts writing daily TILs by - [All The Environment Variables](unix/all-the-environment-variables.md) - [Apply Successive Filters To Lines In Less](unix/apply-successive-filters-to-lines-in-less.md) - [Authorize A cURL Request](unix/authorize-a-curl-request.md) +- [Browse And Search Help Docs](unix/browse-and-search-help-docs.md) - [Cat A File With Line Numbers](unix/cat-a-file-with-line-numbers.md) - [Cat Files With Color Using Bat](unix/cat-files-with-color-using-bat.md) - [Change Default Shell For A User](unix/change-default-shell-for-a-user.md) diff --git a/unix/browse-and-search-help-docs.md b/unix/browse-and-search-help-docs.md new file mode 100644 index 0000000..a6df979 --- /dev/null +++ b/unix/browse-and-search-help-docs.md @@ -0,0 +1,22 @@ +# Browse And Search Help Docs + +There are a lot of tools that don't have dedicated `man` pages, but do have +lengthy output when you pass them the `--help` flag. + +We can make those details easier to browse and searchable by piping them to +`less`. + +```bash +❯ uv run pytest --help | less +``` + +First, we see the top of the output inside `less` instead of bottom of the +output right above our next terminal prompt. + +From `less`, we can use down and up arrows (or `j` and `k`) to navigate through +the details. We can also jump to a specific word or phrase by searching -- type +`/` and then the pattern we're trying to match. `n` and `N` to go to the next or +previous match, respectively. + +See `man less` more more details. And if you like these improvements to viewing +tool usage details, you may also be interested in [a better man page viewer](https://www.visualmode.dev/a-better-man-page-viewer).