Thursday, April 16, 2015

How to get back the deleted histoy in terminal prompt? - a Linux tip

As we know very well about history command that shows the list of commands of a particular terminal.
# history
In this, history -c command is used to clear the history. Remember, you cannot get back the history by pressing up or down arrows now.
But there is a trick to get back the cleared history by giving the following command in the terminal.
One transcript file will be generated after giving this command. Now, don’t give any other command immediately. You need to press up & down arrows for getting back the history.