Skip to content

↑↓ moveEnter openEsc close

Insert the last argument of the 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 Option+. (Mac), Alt+. (Linux, Windows).

More Bash shortcuts: history

ActionMacLinuxWindows
Search history backwardsCtrlRCtrlRCtrlR
Cancel the history searchCtrlGCtrlGCtrlG
Previous commandCtrlPor↑CtrlPor↑CtrlPor↑
Next commandCtrlNor↓CtrlNor↓CtrlNor↓
Run the command and fetch the next from historyCtrlOCtrlOCtrlO

All 36 Bash shortcuts