Moving files in Google Colab Moving files in Google Colab linux linux

Moving files in Google Colab


This also worked for me:

shutil.move("path/to/current/file", "path/to/new/destination/for/file")

So:

shutil.move("/content/cat.10171.jpg", "/content/train") 


!mv "/content/P14-Convolutional-Neural-Networks.zip" "/content/drive/My Drive/U/señales/colab/"

you have to use "" to make it readable


I have an idea , you don't need to move them to colab because after some hours , Colab will restart automatic and all data will removed , so what's solution for that ? Simply, you can copy them to colab from Drive but How can i do that ? Here's solution for that :

!cp "/content/drive/My Drive/*.jpg" "/content/train"

BUt if you still want to move them not copy , Here's solution for that :

!mv "/content/drive/My Drive/*.jpg" "/content/train"

Conclusion , " cp " for copy and " mv " for move