I am using Mac OSX and I am looking for a command that retrieves the history of the outputs (when they exist) of the commands that I ran. Is it possible ?
If you have not used history -w You can reload the history using history -r . If you log out and log in again your history will also be restored.
Searching shell command history Open a terminal application on your Linux or Unix and type history to list all commands. To search for a command in the history, press ctrl+r multiple times.
The command is simply called history, but can also be accessed by looking at your . bash_history in your home folder. By default, the history command will show you the last five hundred commands you have entered.
To enter this mode you simply press ctrl and r. You can then enter a search term and use repeat presses of ctrl and r to step back through the list of previous commands containing that term.
I think Bash only keeps a history of the commands you entered. You can retrieve it by entering 'history'. But I don't think that Bash stores the output of these commands anywhere, this would have to be a feature of your terminal emulator.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With