Search code examples
python-3.xkerasjupyter-notebookgoogle-colaboratory

How to delete a locally uploaded file on google colab?


I'm trying to delete a file that I uploaded on Google colab using the following code:

from google.colab import files
uploaded = files.upload()

How to delete the file now? e.g If the file's name is 'sample.jpg' .


Solution

  • Try this

    !rm sample.jpg
    

    Then check that it is gone with !ls -al

    Update (nov 2018) Now you can click to open left pane, browse the files tab, then right click to select and delete a file.