They offer different flash templates with latest features.
Login

Forgot password
Register
Back
Written by:
efthialex
Score: 30
votes: 39
Format: Article

 How to execute *.sh files on Linux


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.


Tags: .sh files
Created: 3 years ago.
Last edited: 1 year ago.
Reviewed: 3 years ago.
Read 1730 times.

Comments
6 months ago

Kafka
thx  
7 months ago

miked74
Shouldn't step 5 just be:

./name_of_file.sh

Nicely done otherwise, thanks.
 
8 months ago

skelms
A bit easier solution, right click the .sh file, choose properties (the last option) then choose the permissions tab, and select the "allow executing file as program" box, and then hit apply, and presto.  
1 year ago

zenhas
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
 
1 year ago

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

IcyFlame
sh ./name.sh does not run the file. You have to change it into an executable using the first command and then run it outside the terminal to install it.  
1 year ago

efthialex
@Gijsdemik

I updated my post.
 
2 years ago

Flurry
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.
 
2 years ago

dwcunplugged
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.  

Other tutorials from efthialex