Skip to content

↑↓ moveEnter openEsc close

Previous command in Bash

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

In Bash and Zsh, press Ctrl+P or ↑ on Mac, Linux, Windows.

Either combination works; the keyboard shows the first. What else uses Ctrl+P? · What else uses ↑?

More Bash shortcuts: history

ActionMacLinuxWindows
Search history backwardsCtrlRCtrlRCtrlR
Cancel the history searchCtrlGCtrlGCtrlG
Next commandCtrlNor↓CtrlNor↓CtrlNor↓
Insert the last argument of the previous commandOption.Alt.Alt.
Run the command and fetch the next from historyCtrlOCtrlOCtrlO

All 36 Bash shortcuts