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

How to execute .sh and .py file in the workspace?

jimnaik
New Contributor III

I want to execute shell script which is running .py file. May I know how to run .sh file and .py files in Databricks workspace?

1 ACCEPTED SOLUTION

Accepted Solutions

jimnaik
New Contributor III

I tried executing like this and it worked: %sh /dbfs/***/***/***.sh

View solution in original post

2 REPLIES 2

AmanSehgal
Honored Contributor III

Launch a cluster and then go to `Data` section of your workspace. Hit DBFS tab at the top and upload your script and python file into a DBFS location like `/mnt`.

Next, open a notebook and you can run a shell commands by using `%sh` in the cell.

%sh
ls /dbfs/mnt/

jimnaik
New Contributor III

I tried executing like this and it worked: %sh /dbfs/***/***/***.sh

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.