Skip to main content
Bounty Ended with 100 reputation awarded by Adam Smith
added 38 characters in body
Source Link
nonopolarity
  • 149.4k
  • 135
  • 484
  • 769

To use the first argument, you can use !^ or !:1

Example:

$ echo a b c d e 
a b c d e
$ echo !^
echo a
a

$ echo a b c d e 
a b c d e
$ echo !:1
echo a
a

Since your question is about using any other arguments, here are some useful ones:

!^      first argument
!$      last argument
!*      all arguments
!:2     second argument

!:2-3   second to third arguments
!:2-$   second to last arguments
!:2*    second to last arguments
!:2-    second to next to last arguments 

!:0     the command
!!      repeat the previous line

The first four forms are more often used. The form !:2- is somewhat counter-intuitive, as it doesn't include the last argument.

To use the first argument, you can use !^ or !:1

Example:

$ echo a b c d e 
a b c d e
$ echo !^
echo a
a

$ echo a b c d e 
a b c d e
$ echo !:1
echo a
a

Since your question is about using any other arguments, here are some useful ones:

!^      first argument
!$      last argument
!*      all arguments
!:2     second argument

!:2-3   second to third arguments
!:2-$   second to last arguments
!:2*    second to last arguments
!:2-    second to next to last arguments
!:0     command

The first four forms are more often used. The form !:2- is somewhat counter-intuitive, as it doesn't include the last argument.

To use the first argument, you can use !^ or !:1

Example:

$ echo a b c d e 
a b c d e
$ echo !^
echo a
a

$ echo a b c d e 
a b c d e
$ echo !:1
echo a
a

Since your question is about using any other arguments, here are some useful ones:

!^      first argument
!$      last argument
!*      all arguments
!:2     second argument

!:2-3   second to third arguments
!:2-$   second to last arguments
!:2*    second to last arguments
!:2-    second to next to last arguments 

!:0     the command
!!      repeat the previous line

The first four forms are more often used. The form !:2- is somewhat counter-intuitive, as it doesn't include the last argument.

and add another :)
Source Link
rogerdpack
  • 65.5k
  • 38
  • 278
  • 396

To use the first argument, you can use !^ or !:1

Example:

$ echo a b c d e 
a b c d e
$ echo !^
echo a
a

$ echo a b c d e 
a b c d e
$ echo !:1
echo a
a

Since your question is about using any other arguments, here are some useful ones:

!^      first argument
!$      last argument
!*      all arguments
!:2     second argument

!:2-3   second to third arguments
!:2-$   second to last arguments
!:2*    second to last arguments
!:2-    second to next to last arguments
!:0     command

The first four forms are more often used. The form !:2- is somewhat counter-intuitive, as it doesn't include the last argument.

To use the first argument, you can use !^ or !:1

Example:

$ echo a b c d e 
a b c d e
$ echo !^
echo a
a

$ echo a b c d e 
a b c d e
$ echo !:1
echo a
a

Since your question is about using any other arguments, here are some useful ones:

!^      first argument
!$      last argument
!*      all arguments
!:2     second argument

!:2-3   second to third arguments
!:2-$   second to last arguments
!:2*    second to last arguments
!:2-    second to next to last arguments

The first four forms are more often used. The form !:2- is somewhat counter-intuitive, as it doesn't include the last argument.

To use the first argument, you can use !^ or !:1

Example:

$ echo a b c d e 
a b c d e
$ echo !^
echo a
a

$ echo a b c d e 
a b c d e
$ echo !:1
echo a
a

Since your question is about using any other arguments, here are some useful ones:

!^      first argument
!$      last argument
!*      all arguments
!:2     second argument

!:2-3   second to third arguments
!:2-$   second to last arguments
!:2*    second to last arguments
!:2-    second to next to last arguments
!:0     command

The first four forms are more often used. The form !:2- is somewhat counter-intuitive, as it doesn't include the last argument.

added 323 characters in body
Source Link
nonopolarity
  • 149.4k
  • 135
  • 484
  • 769

To use the first argument, you can use !^ or !:1

Example:

$ echo a b c d e 
a b c d e
$ echo !^
echo a
a

$ echo a b c d e 
a b c d e
$ echo !:1
echo a
a

Since your question is about using any other arguments, here are some useful ones:

!^      first argument
!$      last argument
!*      all arguments
!:2     second argument

!:2-3   second to third arguments
!:2-$   second to last arguments
!:2*    second to last arguments
!:2-    second to next to last arguments

The first four forms are more often used. The form !:2- is somewhat counter-intuitive, as it doesn't include the last argument.

To use the first argument, you can use !^ or !:1

Example:

$ echo a b c d e 
a b c d e
$ echo !^
echo a
a

$ echo a b c d e 
a b c d e
$ echo !:1
echo a
a

To use the first argument, you can use !^ or !:1

Example:

$ echo a b c d e 
a b c d e
$ echo !^
echo a
a

$ echo a b c d e 
a b c d e
$ echo !:1
echo a
a

Since your question is about using any other arguments, here are some useful ones:

!^      first argument
!$      last argument
!*      all arguments
!:2     second argument

!:2-3   second to third arguments
!:2-$   second to last arguments
!:2*    second to last arguments
!:2-    second to next to last arguments

The first four forms are more often used. The form !:2- is somewhat counter-intuitive, as it doesn't include the last argument.

Source Link
nonopolarity
  • 149.4k
  • 135
  • 484
  • 769
Loading