I often times want to copy a set of commands from terminal, that do not have an output; say a block like this:
prompt$ less file1.txt
prompt$ less file2.txt
prompt$ dhex file2.txt
prompt$ less file3.txt
Now, if I select this block of text with the mouse, and copy it with Ctrl-Shift-C; then when I paste in a text file, the prompt is there (as expected) - and then I have to waste time deleting the prompt :)
So I was wandering - is there a setting for gnome-terminal, such that when I do the same kind of copying, I end up with only the commands - without the prompt? This is what I want when I finally paste:
less file1.txt
less file2.txt
dhex file2.txt
less file3.txt
I'm interested in a solution that will allow me to get this in clipboard, with just mouse selection and Ctrl-Shift-C; I am aware I could do history X
, but then I'd have to grep
it - and think of a suitable grep expression (and the same problem is if I record a typescript of terminal session with script
).
Any facilities that exist for that? If not for gnome-terminal
, any other terminal that can be used under Gnome that offers such facility?