in Software by (13.6k points)
0 like 0 dislike

How I can to run shell or bash script, i.e. execute file with .sh extension? Me need execute command for run shell script in Linux terminal/console (command line).

how to run sh script

1 Answer

0 like 0 dislike
by (13.6k points)

Open a terminal and navigate to the folder where the .sh file is located. Then type any from below strings:

sh <filename>.sh
bash <filename>.sh

For example:


The terminal has a rich set of powerful tools that are accessible by typing the commands. You need locate the .sh file by typing ls and cd. Once you are in the correct current folder you can run the script like this:


Or you can run and redirect the output to a file:

./ > out.txt

Your answer

Try to answer the question as detailed as possible.
Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.