diff --git a/IPython/core/magics/osm.py b/IPython/core/magics/osm.py index a6e3d64..dcfa2ad 100644 --- a/IPython/core/magics/osm.py +++ b/IPython/core/magics/osm.py @@ -302,33 +302,36 @@ class OSMagics(Magics): """Change the current working directory. This command automatically maintains an internal list of directories - you visit during your IPython session, in the variable _dh. The - command %dhist shows this history nicely formatted. You can also - do 'cd -' to see directory history conveniently. - + you visit during your IPython session, in the variable ``_dh``. The + command :magic:`%dhist` shows this history nicely formatted. You can + also do ``cd -`` to see directory history conveniently. Usage: - cd 'dir': changes to directory 'dir'. - - cd -: changes to the last visited directory. + - ``cd 'dir'``: changes to directory 'dir'. + - ``cd -``: changes to the last visited directory. + - ``cd -``: changes to the n-th directory in the directory history. + - ``cd --foo``: change to directory that matches 'foo' in history + - ``cd -b ``: jump to a bookmark set by %bookmark + - Hitting a tab key after ``cd -b`` allows you to tab-complete + bookmark names. - cd -: changes to the n-th directory in the directory history. + .. note:: + ``cd `` is enough if there is no directory + ````, but a bookmark with the name exists. - cd --foo: change to directory that matches 'foo' in history - - cd -b : jump to a bookmark set by %bookmark - (note: cd is enough if there is no - directory , but a bookmark with the name exists.) - 'cd -b ' allows you to tab-complete bookmark names. Options: - -q: quiet. Do not print the working directory after the cd command is - executed. By default IPython's cd command does print this directory, - since the default prompts do not display path information. + -q Be quiet. Do not print the working directory after the + cd command is executed. By default IPython's cd + command does print this directory, since the default + prompts do not display path information. + + .. note:: + Note that ``!cd`` doesn't work for this purpose because the shell + where ``!command`` runs is immediately discarded after executing + 'command'. - Note that !cd doesn't work for this purpose because the shell where - !command runs is immediately discarded after executing 'command'. Examples --------