Posts Tagged ‘ Bash shell ’

$_ today’s favorite bash shortcut of the day

In Bash and several other shells $_ stores the arguments of the most recent command.  This lets you do something like:

mkdir fun
cd $_

That’s a simple example, making a directory and switching into it.  Where it really comes in handy is when you’re like me and you give the wrong command with a million arguments and want to quickly fix your mistake.  $_ to the rescue!