0

Most linux apps and even basic linux system commands like, awk, grep, sed, etc have "cheat sheets". These sheets give common usage examples of the software on one page. A means to aggregate these and easily retireve an individual "cheat sheet" for a program would save a lot of time in duck-duck-go searches. Retrieve the list from the task bar or through some terminal commandline command and then select the one you are interested in would be a very useful piece of software in my opinion and a real time saver.

2
  • 1
    Could you supply some specific examples of where one finds these cheat sheets? Sep 28, 2022 at 1:47
  • For example, search "grep cheatsheet" on web and you wil find more than 20 choices for cheat sheets. for the grep command. Small pdf files.; usually 1 page. Some are better than others. Nearly every app and linux command has such cheatsheets. I have tried loading these into a couple of note apps for easy retrieval but no success with getting them loaded.
    – tckosvic
    Sep 29, 2022 at 12:55

2 Answers 2

1

Try tldr-pages. It provides a command-line interface to a collection of community written and verified cheat sheets for a wide range of console tools.

You can install a python client with pip: pip install tldr

For example, tldr gives the following hints on using grep:

$ tldr grep

  grep

  Find patterns in files using regular expressions.
  More information: https://www.gnu.org/software/grep/manual/grep.html.

  - Search for a pattern within a file:
    grep "search_pattern" path/to/file

  - Search for an exact string (disables regular expressions):
    grep --fixed-strings "exact_string" path/to/file

  - Search for a pattern in all files recursively in a directory, showing line numbers of matches, ignoring binary files:
    grep --recursive --line-number --binary-files=without-match "search_pattern" path/to/directory

  - Use extended regular expressions (supports `?`, `+`, `{}`, `()` and `|`), in case-insensitive mode:
    grep --extended-regexp --ignore-case "search_pattern" path/to/file

  - Print 3 lines of context around, before, or after each match:
    grep --context|before-context|after-context=3 "search_pattern" path/to/file

  - Print file name and line number for each match with color output:
    grep --with-filename --line-number --color=always "search_pattern" path/to/file

  - Search for lines matching a pattern, printing only the matched text:
    grep --only-matching "search_pattern" path/to/file

  - Search stdin for lines that do not match a pattern:
    cat path/to/file | grep --invert-match "search_pattern"

$ 
1
  • Thanks for answer. Just for info, tldr python install described above did not play well in anaconda python as installed through conda. It installed but environments and prompts got garbled up. Ju7st reinstalled anaconda from backup. Will try npm install into root. I'll report how that goes. Thanks, tom kosvic
    – tckosvic
    Sep 30, 2022 at 15:57
0

You say that there are "more than 20 choices for cheat sheets for the grep command".
It sounds like most of the work will be searching for the URLs of the specific cheat sheet that you personally find best for each command.

Once you have that list, simply write your own web page of links.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.