• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Source Digit

Source Digit

Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • How To
  • Ubuntu
  • Instagram
  • Blogging
  • Android
  • WordPress
  • +More
    • Cloud Computing
    • Gadgets
    • Social Media
    • Technology
  • Write for Us
Home / How To / How To Run A Shell File In Ubuntu – Run .sh File In Ubuntu

How To Run A Shell File In Ubuntu – Run .sh File In Ubuntu

By Sourabh / July 18, 2016 Category: How To, Ubuntu

What is .sh file in Ubuntu and how to run .sh file in Ubuntu. Terminal commands to run a shell file in Ubuntu. Executing a .sh file in Ubuntu is pretty easy. Let us see how.

.sh file is a shell script. A shell script is a text file that contains a sequence of commands for a UNIX/Debian/Linux/Ubuntu-based system. A shell script file contains “script”, a sequence of commands which have a repeated use.

.sh files are Unix (Linux) shell executables files, they are the equivalent (but much more powerful) of bat files on windows. So you need to run it from a Linux console, just typing its name the same you do with bat files on windows. and that means that it uses Bourne Again Shell, so called bash.

How To Run .sh File In Ubuntu Linux

sh-file-07

Executing a .sh file in Ubuntu is pretty easy. If you have a .sh file, follow the steps given below to run .sh shell script file in Ubuntu.

Before running .sh file, you will have to give proper permission to the script. Run the following commands in Terminal:

chmod +x /path/to/yourscript.sh

Once the proper permission is granted, run the .sh script using the command below:

/path/to/yourscript.sh

If the script file is in the current directory, simply use ./yourscript.sh command. In the following command . refers to the current directory. Which means to run a .sh file in the current directory, simply run the command:

./yourscript.sh

Alternative Method

sh-file-01

You can also enable the .sh file to execute as a program. To make a shell script file executable:

  • Right-click on the file
  • Select Properties
  • Select Permissions
  • Select Allow executing file as a program

Once done, simply double-click on the shell file and click run in terminal option.

Tags: change permission .sh file in ubuntu, change permission .sh file in ubuntu 16.04, executing a .sh file in ubuntu, how to run .sh file in windows, how to run a shell file in ubuntu, how to start .sh file in ubuntu, how to use .sh files in ubuntu, linux what is .sh file, open .sh ubuntu, run .sh file in ubuntu, run .sh file in ubuntu 16.04, run sh in terminal, Ubuntu 16.04 run .sh file, ubuntu 16.04 what is .sh file, Ubuntu run .sh file, ubuntu what is .sh file, what is .sh file, what is .sh file in linux, what is .sh file in ubuntu, what is .sh file in ubuntu 16.04

Primary Sidebar

Latest Posts

Delete Directory And Contents Recursively Without Prompt On Linux

Check User Login History In Ubuntu Linux Command Line

Use Locate Command To Find File In Linux Terminal By Name

How To Change Terminal Color In Ubuntu Command Line

How To Run Fsck Manually In Linux To Fix Unexpected Inconsistency

How To Fix Broken Packages On Ubuntu From Terminal

Re Execute The Previous Command In Linux Ubuntu Command Line

How Much RAM Is Needed For Ubuntu PC

How To Find Large Files And Directories In Linux Command Line

How To Use Clear Command History In Linux Terminal

© 2026 Source Digit • Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • About
  • Privacy Policy
  • Terms & Conditions
  • Contact Us
  • Sitemap