You can find this feature in Settings > Download Twitter Archive. It might take 24 hours to receive.
Unzip the file and open the data
folder in your terminal:
cd ~/Downloads/twitter-archive-zip-you-downloaded/data
(I have seen reports that this function may no longer be working, so this guide is mostly useful to those who were lucky enough to already have downloaded their archive.)