razzi.abuissa.net

Razzi's guide to cd

2023-09-20

cd changes your directory.

$ cd hack
hack $

Simple as that! To the left of my $ prompt it shows the directory is now hack.

But there are additional useful features that are not obvious at first glance.

You can cd - to toggle between your 2 most recent directories:

hack $ cd -
$ cd -
hack $

You can run cd without any arguments to go to your home directory:

hack $ cd
$

And you can manage your directory history with fine grained pushd, prevd and nextd:

$ pushd hack
hack $

hack $ prevd
$

$ nextd
hack $