EMBED THIS RECORDING:
<div><script id="playterm-MjAxMS0wOS9zZWVkZWVkYXNodHR5LTEzMTU3NzgwMzh8ODB4MjQ=" type="text/javascript" src="https://playterm.org/js/?hash=MjAxMS0wOS9zZWVkZWVkYXNodHR5LTEzMTU3NzgwMzh8ODB4MjQ=" class="size:80x24"></script></div>
Henry said
wow 'cd -' is a neat trick!..its like windows alt-tab but between directories instead of windows.
nyymi said
You forgot to type just "cd" to get back to your home directory. So the "cd ~"
includes redundant part.
Mestalla said
I always knew you could do something like this, but I could never remember how. Perhaps next time
I'll remember :)
Adrian C said
You can use minus in other commands directly by prefixing with tilda e.g.
echo ~-
ls -l ~-
Adrian C said
You can use minus in other commands directly by prefixing with tilda e.g.
echo ~-
ls -l ~-
John W said
For more control, you can try pushd/popd/dirs
Leon said
nice! I even found out the following :)
Did you know you can also use this for copying files?
$ cd /var/srv/http/projects/foo/
$ ls
.htaccess foo
$ cd ~/www
$ ls
bar
$ cp ~-/.htaccess .
$ ls
.htaccess foo