Live data from Hacker News

Ask HN: Can I see your cheatsheet?

news.ycombinator.com

121–130 of 173 posts

Re: Ask HN: Can I see your cheatsheet?

#121
I use these two commands regularly:

1. `history | grep somecommand` to see a command I used previously. (I have my history set to a bonkers high number.) 2. `curl cht.sh/somecommand` to see a crowdsourced cheatsheet for a command. See: https://cht.sh/grep 3. DuckDuckGo often has good cheat sheets, e.g. https://duckduckgo.com/?q=tmux+cheat

I also use fish, which has nice history-based autocomplete

Re: Ask HN: Can I see your cheatsheet?

#122
post #60

I use my ebooks for reference: * GNU grep and ripgrep ( https://learnbyexample.github.io/learn_gnugrep_ripgrep/ ) * GNU sed ( https://learnbyexample.github.io/learn_gnused/ ) * GNU awk ( https://learnbyexample.github.io/learn_gnuawk/ ) * Ruby one-liners cookbook ( https://learnbyexample.github.io/learn_ruby_oneliners/ ) * Perl one-liners cookbook ( https://learnbyexample.github.io/learn_perl_oneliners/ ) * Command li…

I stumbled upon your vi post a few days ago, really like the style. Keep it up!

Thanks a lot for the feedback, feels great to know the content style suited well for you :)

Re: Ask HN: Can I see your cheatsheet?

#125

Set a huuuuuuuge shell history https://github.com/craigjperry2/dotfiles/blob/aa77ddcbde63bf... then fzf ctrl+r bindings mean you can recall anything right where you need it. If you’re going to do this then have an escape hatch for commands you don’t want memorised https://github.com/craigjperry2/dotfiles/blob/aa77ddcbde63bf...

I also use `history | vim -` to search through the history in the context of other things I was attempting to do. Say, if I try some command and it does not work, chances are it's not the first time and I have the correct version on the line bellow :)

Re: Ask HN: Can I see your cheatsheet?

#126
I just use my bach history. I set it to never expire and I back it up, so it has years of commands I can search, either with Ctrl-R or history|grep. Sometimes I put comments in them to help with searching later.

[edit: turns out a lot of people do that!]

Re: Ask HN: Can I see your cheatsheet?

#127

Earlier quoted context omitted.

same here - my cheatsheet is `history | grep`

I'm curious why history | grep and not ctrl-R?

Regular expressions. Sometimes you remember two non-adjacent parts. Ctrl-R doesn't let you find "when I used find with awk" unless you type in everything in between.

Re: Ask HN: Can I see your cheatsheet?

#128

Set a huuuuuuuge shell history https://github.com/craigjperry2/dotfiles/blob/aa77ddcbde63bf... then fzf ctrl+r bindings mean you can recall anything right where you need it. If you’re going to do this then have an escape hatch for commands you don’t want memorised https://github.com/craigjperry2/dotfiles/blob/aa77ddcbde63bf...

History search is the way, especially with fzf. I love using fzf to pick git branches as well, so long as you use intelligible branch names :)

Re: Ask HN: Can I see your cheatsheet?

#129

This surprised me that people do this. I don't have any, since if I have to look up one, it's not really useful :) But my cheat sheet is google, I usually find what I want in no time.

"my cheat sheet is google" Useful information disappears from the internet all the time. If I find something useful I record it myself so I can easily find it again instead of wasting my time searching for something that may no longer exist.

> Useful information disappears from the internet all the time.

If something is really useful it will stick around, maybe some site goes down but there will be others with the same information.

Re: Ask HN: Can I see your cheatsheet?

#130
Sounds like we need a "github copilot" for the shell. bash on linux can already tell you which command you need to install if necessary. I really don't want to keep cheatsheets any more. I just want to write a shell comment and get the suggestions of the commands. It shouldn't be too hard I think. I guess the problem is how to pay for it.
Post reply on HN