Use # to reverse-search bash commands easier

Use # to reverse-search bash commands easier.

For example, you can run lsof -i :3000 #portsearch

Then later you can run ctrl + r to open up a reverse search, and then type portsearch and this command will pop up.

This works because # is a comment delimiter in bash, so anything after the # isn't processed as a bash command but is still in history so it's searchable.

Subscribe to Dylan Lott

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.