How to Exit or Quit from Spark Shell & PySpark?

Both spark-shell and pyspark have different ways to exit or quit from a shell prompt. For spark-shell use :quit and from pyspark use quit() to exit from the shell. Alternatively, both also support Ctrl+z to exit.

1. Exit or Quit from Spark Shell

Like any other shell, spark-shell also provides a way to exit from the shell. When you are in shell type :quit to come out of the shell prompt.

spark shell exit

Alternatively, you can also use Ctrl+z to exit from the shell.

2. Exit or Quite from PySpark Shell

Similarly to exit or quit from pyspark shell, you can use either quit() or exit() from shell prompt. Let’s launch the shell, run some examples and finally exit from it.

pyspark shell exit

Alternatively, you can also try Ctrl+z to exit from the pyspark shell.

Conclusion

In this quick article, you have learned how to exit or quit from the Spark and pyspark shell. To quit from the spark-shell use :quit and to quit from the pyspark shell use quit()

Happy Learning !!

Naveen (NNK)

I am Naveen (NNK) working as a Principal Engineer. I am a seasoned Apache Spark Engineer with a passion for harnessing the power of big data and distributed computing to drive innovation and deliver data-driven insights. I love to design, optimize, and managing Apache Spark-based solutions that transform raw data into actionable intelligence. I am also passion about sharing my knowledge in Apache Spark, Hive, PySpark, R etc.

Leave a Reply

You are currently viewing How to Exit or Quit from Spark Shell & PySpark?