Friday, October 22, 2010

HowTo: Run the .sh File Shell Script In Linux / UNIX

I've downloaded a software for Linux from the Internet. There is a file called How do I run an .sh file to install the software?

.sh file is nothing but the shell script to install given application or to perform other tasks under UNIX like operating systems. The easiest way to run .sh shell script in Linux or UNIX is to type the following commands. Open the terminal (your shell prompt) and type the command:




.sh File As Root User

Sometime you need to install application which requires root level privalage
Some time you need root access to install application; without root, you won't have the necessary permissions to install application or make system level modifications. Root access is disabled by default on many Linux and UNIX like systems. Simply use sudo or su as follows:

sudo bash
Type your password. Another option is to use the su command as follows to become superuser:

su -
Type root user password and finally run your script:
chmod Command: Run Shell Script In Linux

Another recommend option is to set an executable permission using the chmod command as follows:

chmod +x

Now your can run your .sh file as follows


No comments: