In a normal UNIX terminal,
$ history
It displays the history of commands executed in the past by commands with numbers.
And
$! ◯◯◯ (command number)
You can easily re-execute a previously executed command by typing.
with ipython I was running the command like this "I wish I could easily recall past commands like a terminal ..." When I looked it up, I found the command I was looking for, so I'll leave it here as a memorandum.
In[10]: history -g
With the above command, you can display the history of past commands with numbers.
"-g" is an option that also displays the number.
When you run it, it should look like this:
Find the command you want to re-execute here and check the corresponding command number.
ʻIn [11]: recall ◯◯◯ (command number) ` The "recall" command allows you to recall the command corresponding to that number. For example, if you want to execute the 263rd command again now, I was able to call the command safely.
It's very easy. Simply combine the "history" command option "-g" with the "recall" command. Even so, the number of operations and key inputs is a little larger than that of the terminal.
Recommended Posts