Whenever I download an .sh-file gedit opens up and then freezes. Why?
gedit opens up after the download is complete, that's because your browser is set up to open downloaded files automatically and to open them in the system's default application.
gedit opens up because you double-clicked on the
.sh file in
nautilus, that's because of the default behavior of
nautilus, which is to open
.sh files in the system's default text editor rather than to run them.
nautilus' default behavior:
- Open Files from the Unity Launcher
- On the Unity Panel, click on "Edit" > "Preferences"
- Select the "Behavior" tab and under "Executable Text Files" select "Run executable files when they are opened" and click on the "Close" button.
gedit freezes, it might be that the
.sh file is very long.
.sh is not very long, it might be that it is encoded with some exotic encoding that
gedit cannot handle.
.sh file is not encoded with any exotic encoding, try to reinstall / update gedit by running this command in a Terminal:
sudo apt-get remove gedit && sudo apt-get update && sudo apt-get install gedit
1Thanks! Wouldn't it be a lot more intuitive for us newbies if Ubuntu did run .sh files per default? Apr 21, 2015 at 13:13
sh files aren't double-click executables; they need to be run from the terminal. (
sh files can also be big. More than 10MB of text is sure to freeze up any text program for a while, until it can load all of the text.
1sudo for a unknown script can be dangerous. Apr 20, 2015 at 12:43
@A.B. OK, Mr. Critical. It's edited. Apr 20, 2015 at 15:52
gksudois just as dangerous. It's about to run the script with superuser privileges without it to see before. Apr 20, 2015 at 15:54
@A.B. What would you like? Apr 20, 2015 at 15:55
sudojust gone. Apr 20, 2015 at 15:56