如何在Google Colab上删除本地上传的文件? [英] How to delete a locally uploaded file on google colab?

查看:454
本文介绍了如何在Google Colab上删除本地上传的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用以下代码删除在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()

如何立即删除文件?例如,如果文件名为"sample.jpg".

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

推荐答案

尝试一下

!rm sample.jpg

然后用!ls -al

更新(2018年11月) 现在,您可以单击以打开左窗格,浏览文件"选项卡,然后右键单击以选择和删除文件.

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

这篇关于如何在Google Colab上删除本地上传的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆