After downloading Spark, you need to set the path for SPARK_HOME in the .bashrc file. Execute the below command to open the .bashrc file,
vi ~/.bashrc
After this hit the insert button on your keyboard to edit the .bashrc file. Now, set the SPARK_HOME path as below,
SPARK_HOME=<enter the spark directory path here>
export PATH=$SPARK_HOME/bin:$PATH
After this, source the .bashrc file with the below command,
source ~/.bashrc
Now, everything is set up. You can run the spark shell now.