How to execute *.sh files on Linux

efthialex
  10 years ago
  32

Hey everyone, this is a very simple tutorial which shows you how to execute .sh files step by step:

 

1)First of all, download the file that you are going to execute e.g. "name_of_file.sh" and save it in your Desktop

2)Secondly open the Terminal from Menu Accessories Terminal

3)Now type cd ~/Desktop (With this command we change the default directory "/" to "/Desktop")

4)Then type chmod +x name_of_file.sh to make your file executable.

5)Then type sh ./name_of_file.sh to execute the file.

6)After that continue as usual.

 

 

I hope this tutorial will be of a great help to you all.

Comments
Kafka 10 years ago

thx


zenhas 10 years ago

It's rather copy to Desktop folder and make it executable than install.
.sh is shell script. It doesn't need to be "installed".

Step 3 is wrong. with cd ~/Desktop you won't change to /Desktop directory. You go to the $HOME/Desktop which is completly different game.

Anyway, you can put sh script anywhere, where you are able to write. There is no need to have it on the Desktop.

demote


efthialex 10 years ago

@IcyFlame It's up to you if you want to run your *.sh file outside the terminal.


efthialex 11 years ago

@Gijsdemik

I updated my post.


Flurry 11 years ago

Hello.

Mint updated Firefox to the latest version (12), but failed to change its language from English to Spanish, as all other apps and desktop items did flawlessly.

After 20 minutes of fruitlessly searching some terminal command that would force Firefox to acknowledge the language change, I opted to manually download the darn thing and now I'm faced with the following:

$sudo sh run-mozilla.sh
--> run-mozilla.sh: Cannot execute .

Setup:
Firefox 12 for Linux, downloaded from www.firefox.com
Linux Mint 12 64-bit, using GNOME Classic / MATE

Thanks in advance!


NOTE: Everybody is politely asked to please refrain from replying with any of the customary, albeit totally useless, Linux replies:
- "Why not use instead X app?" (because I want THIS app. Period.)
- Presenting another Distro's (or version's) positive outcome. Pointless.
- Flaming comments (they will be prosecuted with no exceptions)
- Redirecting to an external link (I too used google, so no thanks.)
- Redirect to use man pages (see previous.)
- Try to showoff by asking for a cryptic system log output. 99% of the time they never produce a *usable* follow-up answer. It's a fact.


dwcunplugged 12 years ago

It is really weird that I didn't have to do this when I was using openSUSE, but I had to do this with the LMDE. But, Mint is a much better OS than SUSE, so I am not complaining.