954,228 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to use the yank-nth-arg in bash

As the title, type M-C-y, can use it, but what if i want to use the argument to recall the nth argument in the previous command...Thanks for answering...

dspjm
Light Poster
37 posts since Sep 2010
Reputation Points: 10
Solved Threads: 0
 

Hi there. I just figured this out after reading your thread here, so in case you haven't found it yet, the answer is this:

Type M-(arg)-C-y, so if you wanted to recall the 3rd argument of the last command (note that arg numbering starts at 0) you would hold CTRL-META, type 2, and type y.

Also, if you are on a Mac, you will have to make sure your Terminal is set to use Option as a meta key (Preferences > Settings > Keyboard).

Cheers,
-elliott-

ebarrere
Newbie Poster
1 post since Nov 2010
Reputation Points: 10
Solved Threads: 1
 

Thanks for your answer

dspjm
Light Poster
37 posts since Sep 2010
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: