I want to partially clear my terminal scrollback history, but only from where I have selected with my mouse in the scrollback and up. Is this possible? I'm on a Mac, and I use iTerm2 and Terminal.
Asked
Active
Viewed 4.8k times
5 Answers
0
This is not possible, but you can clear just the screen by pressing Control+L.
Scott - Слава Україні
- 22,532
Mark Stewart
- 958
-1
http://www.pendrivelinux.com/how-to-clear-the-terminal-command-history/
This will clear the history completely. history -c
No way I could find to do a partial.
-2
This command will most probably give you the possible history files. You can open it in a text editor and edit.
ls -a ~ | grep hist
-4
If I have correctly understood your question, I think that you can achieve that by manually editing your history file, ~/.bash_history.
P.S.: In order to save your current session, you have to first close the Terminal.
Scott - Слава Україні
- 22,532
dezzeus
- 856