[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: what's $_ in bash

Le 4/8/23 à 04:35, tom@myposts.ovh a écrit :

in bash shell, what's "$_" variable? where defines it?


It's the last argument of the last command.
I use it often when installing a package.
Something like:
$ apt-cache show "package-name"
[... read the description ...]
$ sudo apt-get install $_

By the way you can also use Alt-. to yank (paste) the last argument.
Keep pressing Alt-. to go through previous arguments.


yassine -- sysadm
+213-779 06 06 23
Looking for side gigs.

Reply to: