Making reverse-incremental-search in terminal easier using comments

Solution 1:

# in some configuration files and programming languages marks comments and is excluded from execution.

Run a command and then create a hashtag using # of the command so that we can find it later.

some-command #mycommand

for example:

sudo dmidecode | grep -A 9 "System Information" #sysInfo

Now I create a hash tag #sysInfo for the command sudo dmidecode | grep -A 9 "System Information" which is used to show system information.

Now search for the hash tag in reverse-i-search (press ctrl+r), in the terminal and type #sysInfo.

You may create as many hash tags for every command and find it later using reverse-i-search.

Note: hashtag used here is not really the same concept as we know in social media. This word is just used to clarify and make it easy for newbies to understand the answer.

source