← Back to context

Comment by aa-jv

14 hours 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 ..

I 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).