Ask HN: Can I see your cheatsheet?
Almost everyone I know keeps a list of (easily forgettable) command line snippets somewhere. I can't imagine that HN folks would be any different :)
So that said, could I please see your cheatsheet?
I'll go first: https://github.com/fastily/cheatsheet
172 comments
[ 3.6 ms ] story [ 232 ms ] threadMarkdown: https://pilabor.com/blog/2021/04/markdown-cheatsheet/
I usually just man the command and / my way either to the Examples section, or search for whatever other question I may have.
But I'm on OpenBSD, where man pages are worth the time you spend reading them.
Other than that, although I always intend to add useful stuff to my ~/txt/scratch, in the end it's either Ctrl-R or history | grep.
Searching history or keeping your own notes work but this is easier for me. Everyone finds a work flow they like. It might not be the tool for you.
--> This is actually a real problem on forums --> just to remind a stranger on a forum to commment on something. --> I´m working on a concept / tool to make it simple.
--> Would you like to talk about that? Ron.
If I ever get round to editting/refining these I plan to do it on https://devhints.io - https://devhints.io/xpath and https://devhints.io/bash are so nice.
https://github.com/valbaca/notes
powered by https://github.com/cheat/cheat
Sounds pretty messy but I've never felt the need to maintain a cheatsheet.
I don't see why one would. I know I'm possibly being naive.
https://www.raycast.com/ https://www.raycast.com/extensions/snippets/
Combined with https://www.alfredapp.com/help/features/clipboard/ you get great productivity, especially when working on sys admin terminal kind of stuff
Bonus: it's all stored in a git repo
I do kinda live on the command line, ymmv
I also liked the idea here to prefix all your scripts https://news.ycombinator.com/item?id=31846902 and would personally recommend using fish or zsh with the improvements from ohmyzsh for autocomplete and hints.
I do like the cheat command but it's still not habitual to use it, I grew up with Google so I'm far too dependent on it.
Cheat Sheet Help : https://cht.sh/:help
Cheat Sheet List of topics : https://cht.sh/:list
Being able to use curl as a client as well is so powerful as well. Whenever you are using ssh on some vps you can still get cheatsheets for all your commands.
doc () { curl "https://cheat.sh/$1" | less }
One thing I try to do is to keep my keyboard shortcuts consistent between programs/systems. That way the chance of my instinct of pressing `<CTRL>+a` to move the cursor to the start of the line will be correct more often.
Another thing I try to do when a project has a set of complex commands that are needed, is to add them as a rule in its Makefile, that way they're available for my colleagues as well.
[0] https://github.com/cantino/mcfly
H() { history | egrep -v '^ *[[:digit:]]+ +H +' | grep "$@" | sort -rk 2 | uniq -f 1 | sort; }
[1] - https://github.com/larkery/zsh-histdb
I also maintain cheatsheets for some dev stuff: https://github.com/darekkay/config-files/tree/master/cheat-s...
And then there's my Flexbox cheatsheet: https://darekkay.com/flexbox-cheatsheet/
https://en.cppreference.com/mwiki/index.php?title=cpp/langua...
But my cheat sheet is google, I usually find what I want in no time.
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.
If something is really useful it will stick around, maybe some site goes down but there will be others with the same information.
(the -mount stops it traversing into mounted shares)
zsh's built-in globbing features can be used instead.
In most of the above examples "print -l" is used to print the results to the terminal, but you can instead use whatever command you want (as in the "rm" example above).Many more examples and tips can be seen here: [1]
[1] - http://www.zzapper.co.uk/zshtips.html
Not helpful in this case since you have other options, but maybe helpful for things like bulk touch, chmod, etc.
Secondly, you may want to add -n 200 to your xargs so if you have very, very many files bash doesn't complain.
So:
Find all files and do something to each one