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

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group