0

I am learning to work on google colab. For some reason, I did cd enter.

Now when I do !pwd

output : /root

when I do: ls!

output: googleplay

This is a file I was supposed to create in another folder.

Now I am not able to figure out how to get into the folder that I have in colab. I am trying to go to the folder called tutorial that I have in colab. I don't know how to get to this location

This is the tree structure of my directory

-Sample_data

-tutorial

  • tutorial

I know these files are stored in the content folder. But how should I find path to this

Argyll
  • 6,767
  • 3
  • 19
  • 38
user1476747
  • 1
  • 2
  • 3
  • are you asking for a way to get the directory of a specific file when you input the file name itself? – Gio Nov 12 '19 at 14:36
  • so currently I am in root directory of google collab but I need to access the content directory. The root and content directory are in same level and I cannot go further back than root directory – user1476747 Nov 12 '19 at 16:13
  • To be more precise there bin, content, root and many directories. While I was using content directotry. When I did cd command I reached inside root directory. Now I am not able to figure out how to move to content directory from root. – user1476747 Nov 12 '19 at 16:17

2 Answers2

0
%cd <directoryname>

This is a magic function to change the directory.

Ajai
  • 706
  • 6
  • 21
0

I believe this question was already answered here: Changing directory in Google colab (breaking out of the python interpreter)

As the thread suggests, use:

%cd DIRECTORY_NAME

I hope this will help.

Sadmi
  • 151
  • 13