how to show hidden files colab

Viewed 1684

I'm using colab on python3 how to view or show hidden files

here

like in this image I can't see the hidden files(. files)

3 Answers

Meanwhile a clumsy workaround would be to use i.e !cp to copy the files to your google drive storage (if you have one), make the changes and copy them back. Example:

from google.colab import drive
drive.mount("/content/gdrive")
%cd /root 
%ls -a
 >   .cache/     .gsutil/   .local/   .tmux.conf* ... .bashrc* ...
!cp /root/.bashrc* /content/gdrive/folder
#make changes on bashrc and copy back
!cp /content/gdrive/folder/.bashrc /root/.bashrc

Since i'm using colab-ssh + github + vscode i can browse all folders and files inside vscode and make changes there. But this setup requires some preliminary work.
A faster way is to register for a free ngrok account, copy the authtoken and run following commands:

!pip install colabcode
from colabcode import ColabCode
ColabCode(password="anything", authtoken="your token")
.
.
.
Code Server can be accessed on: NgrokTunnel: "https://8348-34-125-56-97.ngrok.io" -> "http://localhost:10000"
[2022-03-31T08:01:58.749Z] info  code-server 3.10.2 387b12ef4ca404ffd39d84834e1f0776e9e3c005
[2022-03-31T08:01:58.751Z] info  Using user-data-dir ~/.local/share/code-server
..
..

After clicking the ngrok.io link you have to insert your password. Once the editor opens, you can click on "open folder", choose the base "/ " folder. And there you can browse through all files and make changes directly in the editors interface: enter image description here

hi

now they updated the site with a eye symbol indicating hidden items

In a google colab environment, the following command can show all the files including hidden files (in long list format) in a console mode if it satisfies your need in a different way.

!ls -al
Related