In [1]:
import os

In [2]:
print(os.getcwd())


/Users/mbp/Documents/my-project/python-snippets/notebook

In [3]:
!pwd


/Users/mbp/Documents/my-project/python-snippets/notebook

In [4]:
%pwd


Out[4]:
'/Users/mbp/Documents/my-project/python-snippets/notebook'

In [5]:
!cd data

In [6]:
print(os.getcwd())


/Users/mbp/Documents/my-project/python-snippets/notebook

In [7]:
%cd data


/Users/mbp/Documents/my-project/python-snippets/notebook/data

In [8]:
print(os.getcwd())


/Users/mbp/Documents/my-project/python-snippets/notebook/data

In [9]:
!pwd


/Users/mbp/Documents/my-project/python-snippets/notebook/data

In [10]:
%pwd


Out[10]:
'/Users/mbp/Documents/my-project/python-snippets/notebook/data'

In [11]:
cd ..


/Users/mbp/Documents/my-project/python-snippets/notebook

In [12]:
print(os.getcwd())


/Users/mbp/Documents/my-project/python-snippets/notebook

In [13]:
os.chdir('data')

In [14]:
print(os.getcwd())


/Users/mbp/Documents/my-project/python-snippets/notebook/data