Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to show hidden files colab

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)

like image 440
koushik Avatar asked Sep 15 '25 10:09

koushik


2 Answers

hi

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

like image 150
koushik Avatar answered Sep 17 '25 06:09

koushik


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

like image 20
Marcel Moczarski Avatar answered Sep 17 '25 05:09

Marcel Moczarski