How To Run sh File In Linux

how to run sh file in linux

As a Linux user, you have faced about a .sh file.

It happened sometimes you have downloaded an application includes a single .sh file (Example: Jad64.sh) and you don’t understand how to run sh file in Linux.

In this post, I will show you the simple process with a cool example.

So, Let’s Start

What is a sh file ?

The .sh file is some bash scripts contains in a text file.It can run with a bash interpreter easily.The positive side of .sh file that it can run on any Linux/Unix operating system.So, you don’t need to compile any application separately for different platforms.

How To Run sh File In Linux

Running .sh file in Linux Operating System is fairly simple.To run any .sh file to your Linux system, download a .sh file from internet.We have used JDownloader as an example.

Note: We Have used Ubuntu as our default OS.Don’t Worry! you can use any other Linux-Based Operating System here.

  • After downloading the JDownloader or your own .sh file put it on the desktop.Now rename it as a short form.We have renamed it as “jd.sh”.It is not important but you can easily type it in Terminal.

copy sh file to desktop

  • Now open Terminal from Dash or press CTRL+T and enter the following code.It will access to your Desktop directory.

cd Desktop

open terminal

  • Now write the following code.We have used “jd.sh” as .sh filename.You can use your preffered filename here.The “chmod +x” command allows to enable permission of the .sh file.

chmod +x jd.sh

run chmod command

  • Now write down the following with your .sh filename.we have used “jd.sh” because of the example.The “sh ./” command lets you to run the file.

sh ./jd.sh

run sh file

  • After entering the command the application installer will run.Sometimes it shows some dependencies as like JAVA or others.If occurred, simply install the dependencies and run the .sh file again.

install jdownloader

A Simple Tricks

When you run a .sh file, sometimes it will show about the root access.Without root,you can’t access or run the .sh file.In the meantime just enter the following commands.

sudo chmod +x your_filename.sh

After entering this command it will ask for your root password.Simply enter the root password and run the file.

Conclusion

In this post, I have covered about How To Run sh File In Linux.If you have any question or suggestion please leave a comment and I will answer quickly.

You can check Best Linux Mini PC for your home from here >>Best Linux Mini PC<<

And also, check the best Linux gaming distro from <<<Here>>>

Leave a Reply

1 Comment on "How To Run sh File In Linux"

Notify of
avatar
Sort by:   newest | oldest | most voted
abc
Guest

Why the ‘sh’ at the start of the command? If the file is executable, and your already in a command shell, what is the benefit of running another shell?

wpDiscuz