cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
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

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local communityโ€”sign up today to get started!

Sign Up Now