##// END OF EJS Templates
Merge pull request #12886 from MrMino/reformat_cd_magic_docs...
Matthias Bussonnier -
r26421:0e4d6390 merge
parent child Browse files
Show More
@@ -302,33 +302,36 b' class OSMagics(Magics):'
302 """Change the current working directory.
302 """Change the current working directory.
303
303
304 This command automatically maintains an internal list of directories
304 This command automatically maintains an internal list of directories
305 you visit during your IPython session, in the variable _dh. The
305 you visit during your IPython session, in the variable ``_dh``. The
306 command %dhist shows this history nicely formatted. You can also
306 command :magic:`%dhist` shows this history nicely formatted. You can
307 do 'cd -<tab>' to see directory history conveniently.
307 also do ``cd -<tab>`` to see directory history conveniently.
308
309 Usage:
308 Usage:
310
309
311 cd 'dir': changes to directory 'dir'.
310 - ``cd 'dir'``: changes to directory 'dir'.
312
311 - ``cd -``: changes to the last visited directory.
313 cd -: changes to the last visited directory.
312 - ``cd -<n>``: changes to the n-th directory in the directory history.
313 - ``cd --foo``: change to directory that matches 'foo' in history
314 - ``cd -b <bookmark_name>``: jump to a bookmark set by %bookmark
315 - Hitting a tab key after ``cd -b`` allows you to tab-complete
316 bookmark names.
314
317
315 cd -<n>: changes to the n-th directory in the directory history.
318 .. note::
319 ``cd <bookmark_name>`` is enough if there is no directory
320 ``<bookmark_name>``, but a bookmark with the name exists.
316
321
317 cd --foo: change to directory that matches 'foo' in history
318
319 cd -b <bookmark_name>: jump to a bookmark set by %bookmark
320 (note: cd <bookmark_name> is enough if there is no
321 directory <bookmark_name>, but a bookmark with the name exists.)
322 'cd -b <tab>' allows you to tab-complete bookmark names.
323
322
324 Options:
323 Options:
325
324
326 -q: quiet. Do not print the working directory after the cd command is
325 -q Be quiet. Do not print the working directory after the
327 executed. By default IPython's cd command does print this directory,
326 cd command is executed. By default IPython's cd
328 since the default prompts do not display path information.
327 command does print this directory, since the default
328 prompts do not display path information.
329
330 .. note::
331 Note that ``!cd`` doesn't work for this purpose because the shell
332 where ``!command`` runs is immediately discarded after executing
333 'command'.
329
334
330 Note that !cd doesn't work for this purpose because the shell where
331 !command runs is immediately discarded after executing 'command'.
332
335
333 Examples
336 Examples
334 --------
337 --------
General Comments 0
You need to be logged in to leave comments. Login now