Fish maintains a history of all commands you have executed.
- To list the history in reverse chronological order:
- To list the history along with the time at which each command was executed:
$ history --show-time
Note that this is a very useful feature to check when a particular command was executed. However, this feature was only added in Fish 2.4.0 and is not available in older versions.
- To search for a substring
$ history foo
- To merge the history of all open sessions of Fish right now:
$ history --merge
Fish does this merge only when it is exited. This is because Fish does not want to update the common history file at the end of every command. This might be for performance and to avoid race conditions.
However, sometimes you execute a long command in one Fish session and might want to repeat that in another session. This is a quick way to merge all histories, so that that command is now available in history of the second session for easy autocompletion.
Tried with: Fish 2.4.0 and Ubuntu 14.04