People & Blogs

Command Line Cheat Sheets

by Elijah Manor

Share:

📚 Main topics

  • Install tldrInstall tldr with Homebrew or another package manager, then update its cache to download command pages for offline use. 0:00
  • Explore command examplesRun tldr with a command name, such as brew, to see practical examples; use the color option when piping output to less to preserve colored text. 0:00
  • Search interactively with fzfPipe tldr’s list of supported commands into fzf to search thousands of entries, then pass a selection to tldr with xargs to display its help page. 1:01
  • Add a preview and aliasConfigure fzf with a larger preview window that preserves colors, and save the command as an alias in bashrc or zshrc for reuse. 1:31

✨ Key takeaways

  • Practical, searchable helptldr offers community-driven, example-based command help, while fzf makes its extensive command list easier to navigate. 0:00
  • Keep colors in previewsPreserve colorized output when piping help pages so it remains readable in less and fzf previews. 0:30

🧠 Lessons learned

  • Build the workflow in stepsInstall tldr, populate its cache, and combine its command list with fzf and xargs to find and display help pages. 0:30
  • Save frequently used commandsAn alias such as TLDRF lets you launch the interactive workflow without retyping the full command. 1:31

🏁 Conclusion/next steps

  • Set up your own shortcutAdd the interactive command to your shell configuration and use it whenever you need quick command examples. 1:31

Transcript excerpt

0:00 TLDR provides example-based and community-driven man pages. In this episode, we're going to install the tool and integrate it with fzf for a more interactive experience. First, start by installing from Brew or your package manager of choice. Then typing TLDR will output the help usage for the package. To get practical help examples for a command, you provide that to TLDR. We'll try Brew. But this is the first time we've used TLDR and we need to download the commands into an offline cache.

0:30 So we could run TLDR {dash} {dash} update to populate the cache. Now we can run our previous command TLDR Brew and we'll see numerous user-friendly examples of commands and what they do. If you want to pipe the results to something like less, you'll need to provide the flag {dash} {dash} color equals always to keep the colorized output. And then you could page and search through the results using less. If you wanted to list all the commands that are supported, you could pass the {dash} {dash} list flag and wow, that's a lot. To make this a bit more

🔒 The full, searchable transcript is available with Pro.

🔒 Unlock Premium Features

This is a premium feature. Upgrade to unlock unlimited Q&A, transcripts, mindmaps, and translations.

🔒 Unlock Premium Features

Access to Chat is a premium feature. Upgrade now to unlock unlimited studying tools.

🔒 Unlock Premium Features

Access to Mindmap is a premium feature. Upgrade now to unlock unlimited studying tools.

🔒 Unlock Premium Features

Access to Translation is a premium feature. Upgrade now to unlock unlimited studying tools.

Get unlimited summaries, Q&A, transcripts and more with Pro

Upgrade to Pro

Suggestions

🔒 Unlock Premium Features

Access to AI Suggestions is a premium feature. Upgrade now to unlock unlimited studying tools.