

vampatori
vampatori@feddit.uk
Joined
1 posts • 2 comments
Which follows the similar functionality used by the cd -
command to switch to the previous directory you were in. Very handy!
There’s more! Well, it’s more a bash thing than a cd thing… in bash the variable $_
refers to the last argument to the previous command. So you can do the following:
> mkdir -p my/nested/dir
> cd $_
> pwd
/home/user/my/nested/dir
It’s handy for a whole host of things, like piping/touching then opening a file, chown then chmod, etc.