6

What is mean by $_ , It may used like this

mkdir testdirectory;cd $_

It will redirect to the new directory

testdirectory

if i use like this , echo $_

It shows

testdirectory

Which means previously created directory.Actually what it means, I don't know really

1
  • 2
    The duplicate question is not really an answer to this one. It can be derived from that, but IMO that's not the same thing at all.
    – Raydot
    Commented Oct 12, 2019 at 17:39

1 Answer 1

13

what it means, I don't know really

$_ means the last argument to the previous command.

Example:

echo "FOO" "BAR"
FOO BAR
echo $_
BAR

Read more here.

Not the answer you're looking for? Browse other questions tagged .