Running Bash “.sh” files on Ubuntu 12.04LTS

In recent months we’ve setup several Virtual Private Servers which have required several bash files to be ran.

Bash files are one of the ways of scripting with Linux. Bash files have the extension, “.sh” and stand for shell script.

To run a shell script simply open terminal.

Once in terminal type, Bash and then the name of your script file.

For example if you were setting up Virtualmin on a new installation of Ubuntu Linux 12.04LTS.

  1. Open terminal and type, “sudo wget”
  2. Type, “sudo bash”

Congratulations you’ve now just ran your very first Bash Script on linux.

It is recommended before running an install script to run the following commands in terminal;

sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade