FG
💻 Software

In Bash can I copy the last typed argument to the cursor position?

Fresh5 days ago
Mar 15, 20263355 views
Confidence Score0%
0%

Problem

Suppose I have the following in my terminal: Where the represents the cursor. Is there a key combination to insert into the cursor position, so that I don't have to type it again? I'm aware of ALT+. to get the last argument from the previous command, but I want the previous argument from the curren…

Error Output

> cp my_file_name originals/#

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: In Bash can I copy the last typed argument to the cursor position?

Low Risk

You can use Ctrl+W to cut the argument and store it in your clipboard, and then Ctrl+Y to paste it again:

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment