4 ms·
My favourite shell trick is to comment my code: $ some_long_command -with -args -easily -forgotten # thatspecialthing ... Some weeks later .. $ CTRL-R<sp
by aa-jv 7mo ago
My favourite shell trick is to comment my code:
$ some_long_command -with -args -easily -forgotten # thatspecialthing
... Some weeks later ..
$ CTRL-R<specialthing>
.. finds:
$ some_long_command -with -args -easily -forgotten # thatspecialthing
Need to see all the special things you've done this week/whenever?
$ history | grep "\#"
...
Makes for a definite return of sanity ..
- senectus1 7mo agoomg >$ CTRL-R<specialthing> I could kiss you.. this alone is amazing!
- aa-jv 7mo agoYes indeed, it is very fun to discover this if you don't know it already, it expands your understanding of your shell life immensely, doesn't it?
- fragmede 7mo agohttp://atuin.sh http://atuin.sh adds a database to store history in and a custom app to use for lookup with added modes to help with searching.
- 000ooo000 7mo ago!?specialthing? If you are feeling brave
- skydhash 7mo agoI don’t keep history. Any commands I think will be useful, I save it in a script.
- scbrg 7mo agoI once saw this pattern referred to as a bashtag, which I think was an excellent name (no matter if you actually run bash as your shell or not).
- aaravchen 7mo agoOne of the peer comments alludes to this and mentions that it's bash only. Doesn't work in zsh by default apparently.