This character will reference the Terminal's history, and give you options to rerun various commands.
The more common approach besides using the arrow keys is to use the Terminal's repeat character, which is a simply exclamation point. In reviewing the output of the "history" command, there are various approaches you can use to rerun the previously entered commands. In this example command number 3 (ls) was rerun. Rerunning commands You can rerun prior commands by referencing them from the history.
The output of the history command can be long at times and show hundreds of prior commands, so if you would only like to show the most recent ones, you can supply a number after the word "history" to show only that number of previous commands (e.g., "history 10" to show the last 10 commands entered). Unlike opening the history file, the history command will include the contents of both the file and the active history buffer. While accessing the history files can be done as stated, the more complete way to do so (at least for your account's history) is to use the "history" command in the Terminal. If someone has a Terminal session open and has run three or four commands, then these will not be written to the history file until the session is closed. The one caveat to accessing the history file directly is it will only contain the commands from closed Terminal sessions. With these commands you should see a listing of the commands previously run for your account, but can also use these commands to target the history files of other users on the system, such as the following: These files can be opened with the following two commands (among others) in a fresh Terminal window: The first is to directly access the history file for your user account, which is a hidden file called ".bash_history" at the root of your home directory.
There are several options for listing the Terminal history. Listing the history The Terminal history will reveal all commands entered in the current session and those from any prior (but now closed) sessions. The Terminal is able to do this because it stores a small history of the commands you have run both in its current history buffer (memory not written to disk) as well as storing the history buffers from prior Terminal sessions in a small hidden file called ".bash_history." While using the up and down arrows will allow you to navigate these, you can also list them all or part of them both for your account and for other accounts, and also rerun commands quickly, in addition to using the history to transfer commands to other Terminal sessions. In addition to this approach, the Terminal supports a number of other options for revealing and rerunning entered commands. This can easily be done by pressing the up arrow, scrolling through the previous commands, and then pressing Enter to execute the selected one again. There are times when using the Terminal that you might enter a command or two and then want to either run it again or review a whole sequence of commands that have been entered.