Use same arguments with different command

Vlad the Impala

Here's something I find myself doing often:

less super/long/file/name

Followed by:

vim super/long/file/name

Is there an easy way to pass the args of the previous command over to the next? SO I'd like to do something like

vim !!!

And have it automatically open super/long/file/name in vim.

gypaetus

Using !$ should work to access the last argument of the previous command in the bash shell:

less super/long/file/name
vim !$

Also Meta + . or Esc + . can be used to paste the last argument if the readline library is enabled in emacs mode (default option).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

how to conditionally run different command with same arguments

From Dev

How can I run a different command but with the same arguments?

From Dev

How to use the same command for different targets?

From Dev

How to use same grunt task with different options/arguments?

From Dev

Different arguments with same template

From Java

Different arguments, but behavior of function is same

From Dev

functions with different names but same arguments

From Dev

Is there any way to run same grunt command in Mac and Windows but with different options or arguments?

From Dev

use commandline arguments in a sed command

From Dev

How to use multiprocessing to parallelize two calls to the same function, with different arguments, in a for loop?

From Dev

Rerunning the same command with a different parameter

From Dev

Run same command with different parameters

From Dev

Same Linux command with different results

From Dev

Re run previous command with different arguments

From Dev

parse command line arguments in a different order

From Dev

What are the different arguments passed to tar command?

From Dev

What are the different arguments passed to tar command?

From Dev

parsing/converting command line arguments into different types

From Dev

How to execute a command repeatedly with different arguments?

From Java

Jest mock the same function twice with different arguments

From Dev

Function returns different answers with same arguments

From Dev

Template class methods with different arguments but same code

From Dev

Ruby threads calling the same function with different arguments

From Dev

c variadic functions, same arguments, different formats

From Dev

Python - overload same function with different arguments

From Dev

How to parallelize the same function using different arguments?

From Dev

how to use ssh command to connect to multiple computers and send different commands to each computers at same time

From Dev

use tree command output to create the same directory tree structure in different place

From Dev

Two different arguments for the same function but return different results?

Related Related

  1. 1

    how to conditionally run different command with same arguments

  2. 2

    How can I run a different command but with the same arguments?

  3. 3

    How to use the same command for different targets?

  4. 4

    How to use same grunt task with different options/arguments?

  5. 5

    Different arguments with same template

  6. 6

    Different arguments, but behavior of function is same

  7. 7

    functions with different names but same arguments

  8. 8

    Is there any way to run same grunt command in Mac and Windows but with different options or arguments?

  9. 9

    use commandline arguments in a sed command

  10. 10

    How to use multiprocessing to parallelize two calls to the same function, with different arguments, in a for loop?

  11. 11

    Rerunning the same command with a different parameter

  12. 12

    Run same command with different parameters

  13. 13

    Same Linux command with different results

  14. 14

    Re run previous command with different arguments

  15. 15

    parse command line arguments in a different order

  16. 16

    What are the different arguments passed to tar command?

  17. 17

    What are the different arguments passed to tar command?

  18. 18

    parsing/converting command line arguments into different types

  19. 19

    How to execute a command repeatedly with different arguments?

  20. 20

    Jest mock the same function twice with different arguments

  21. 21

    Function returns different answers with same arguments

  22. 22

    Template class methods with different arguments but same code

  23. 23

    Ruby threads calling the same function with different arguments

  24. 24

    c variadic functions, same arguments, different formats

  25. 25

    Python - overload same function with different arguments

  26. 26

    How to parallelize the same function using different arguments?

  27. 27

    how to use ssh command to connect to multiple computers and send different commands to each computers at same time

  28. 28

    use tree command output to create the same directory tree structure in different place

  29. 29

    Two different arguments for the same function but return different results?

HotTag

Archive