commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
eh stands for Edit History
Frequently, I'll mistype a command, and then step back through my history and correct the command. As a result, both the correct and incorrect commands are in my history file. I wanted a simple way to remove the incorrect command so I don't run it by mistake.
When running this function, first the ~/bash_history file is updated, then you edit the file in vi, and then the saved history file is loaded back into memory for current usage.
while in vi, remember that `Shift-G` sends you to the bottom of the file, and `dd` removes a line.
this command is different than bash built-in `fc` because it does not run the command after editing.
There are 2 alternatives - vote for the best!
If you can do better, submit your command here.
You must be signed in to comment.