IPython Magic Commands in Jupyter Notebook (2026) - Part 5 | Step-by-Step Guide
Magic-Commands-5 Magic Commands ¶ In Jupyter Notebook, Magic Commands are special built-in commands that provide additional functionality beyond normal Python commands. They help users perform tasks such as file handling, timing code execution, managing variables, and controlling the notebook environment more easily. Magic commands usually start with % for line magics and %% for cell magics. They are designed to make working in Jupyter Notebook faster and more interactive. 1. %dirs ¶ Shows the current directory stack (folders navigated using pushd/popd). Useful for tracking directory navigation history in Jupyter. In [5]: % dirs Out[5]: [] In [2]: % pushd Out[2]: ['~\\Projects\\Magic-Commands'] In [4]: % popd C:\Users\schol\Projects\Magic-Commands popd -> ~\Projects\Magic-Commands In [6]: pwd Out[6]: 'C:\\Users\\schol\\Projects...