Recently, I needed to write my terminal output down. And I've read this question to find the answer. But now, I would like to write my commands down (which I type in terminal, for example:sudo apt update etc.) to store the history of what I have done earlier.
How can I save my input to file and simultaneously run this input?
P.S. script comprises too many rubbish of type: ^[[? ^[[m etc. I would like to get more simple way, which saves my commands only.