cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

how do i delete files from the DBFS

tthorpe
New Contributor

I can't see where in the databricks UI that I can delete files that have been either uploaded or saved to the DBFS - how do I do this?

3 REPLIES 3

PaulLintilhac
New Contributor III

you can ssh into your cluster if you configured it with a public key at creation time. BUT this question is still relevant because I am having trouble deleting files in the /dbfs directory. I accidentally ended up creating a huge number of streams with different chekcpoints paths in my top level dbfs directory. now when I try to

rm -rf checkpoint_path
, it takes FOREVER to delete. And I can't use my cluster since they consume so much memory. They wont even go away when I make an entirely new cluster!

SophieGou
New Contributor II

Open a notebook and run the command

dbutils.fs.rm("/FileStore/tables/your_table_name.csv")

referencing this link

https://docs.databricks.com/data/databricks-file-system.html

agonsa
New Contributor II

This works! Thanks! To be abundantly clear, this means "Open a Python notebook in Databricks, be sure it's attached to an active cluster, and then run the below command"

dbutils.fs.rm("/FileStore/tables/<your_table_name>.csv")

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.