Comment terminal commands to find them later more easily

Published on in Miscellaneous

If you append a comment (like # foo) to a terminal command, you can search by the comment text when using Ctrl+R.

Full example:

curl http://1.2.3.4/linux.iso  # Fred's distribution of Linux

Later you can press Ctrl+R and search for e.g. "Fred" to find the command.

The example is from climagic's YouTube video Using comments in the interactive shell (3:32).