FG

When I paste a command on my bash prompt it is not in history — how can I add it?

Fresh3 days ago
Mar 15, 2026912 views
Confidence Score0%
0%

Problem

When I paste a command to my OS X or Ubuntu bash prompt using CmdV, the command is not in history – even if it is executed. The command is in history only if I type it. How to enable that pasted commands get into bash's history?

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: When I paste a command on my bash prompt it is not in history — how can I add it?

Low Risk

There's an 'ignorespace' directive that won't save commands with blankspace at the start of the line, which is possible when you're cutting and pasting. There's an 'ignoredups' directive that only saves the earliest instance of a command, which migh…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment