This is a development version (9.14.0.dev) and may be unstable. Go to latest (9.13.0)
{ } Raw JSON

bundles / IPython 9.14.0.dev / IPython / core / magics / osm / OSMagics / cd

function

IPython.core.magics.osm:OSMagics.cd

source: /IPython/core/magics/osm.py :297

Signature

def   cd ( self parameter_s = '' )

Summary

Change the current working directory.

Extended Summary

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 -<tab> to see directory history conveniently. Usage:

  • cd 'dir': changes to directory 'dir'.

  • cd -: changes to the last visited directory.

  • cd -<n>: changes to the n-th directory in the directory history.

  • cd --foo: change to directory that matches 'foo' in history

  • cd -b <bookmark_name>: jump to a bookmark set by %bookmark

  • Hitting a tab key after cd -b allows you to tab-complete bookmark names.

Options:

-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.

Examples

:: In [10]: cd parent/child /home/tsuser/parent/child

Aliases

  • IPython.core.magics.OSMagics.cd