Skip to content

↑↓ moveEnter openEsc close

Run the command and fetch the next from history in Bash

Bash Bash 5.2 / Zsh 5.9 · 36 shortcuts · checked Nov 2026 · Source: GNU Project docs

In Bash and Zsh, press Ctrl+O on Mac, Linux, Windows.

What else uses Ctrl+O?

More Bash shortcuts: history

ActionMacLinuxWindows
Search history backwardsCtrlRCtrlRCtrlR
Cancel the history searchCtrlGCtrlGCtrlG
Previous commandCtrlPor↑CtrlPor↑CtrlPor↑
Next commandCtrlNor↓CtrlNor↓CtrlNor↓
Insert the last argument of the previous commandOption.Alt.Alt.

All 36 Bash shortcuts