At One Place

.sh files

.sh file
Shell Script
A text file of Unix shell commands, run by bash, zsh or sh.

What opens a .sh file

Windows
Git Bash, Windows Subsystem for Linux, Notepad (built in — to read)
macOS
Terminal (built in — bash script.sh), TextEdit (built in — to read)
Linux
Terminal (built in — bash script.sh), Text Editor (built in)

What a .sh file is

Shell scripts automate command-line work on macOS, Linux and any Unix system. To run one you normally make it executable with chmod +x and call it as ./script.sh, or run bash script.sh directly. As with any script it is plain text — read it before running something you downloaded, particularly the ones that pipe a web download straight into a shell.

Converting it

A .sh file is commonly converted to .bat, .ps1 or .txt. It is a plain text format, so any text editor can open and edit it directly.

Details

Extension
.sh
Full name
Shell Script
Category
Programs and installers
MIME type
application/x-sh
Created by
Unix shell convention
Format
Plain text

Common questions

How do I open a .sh file?
On Windows use Git Bash; on macOS use Terminal (built in — bash script.sh); on Linux use Terminal (built in — bash script.sh). A text file of Unix shell commands, run by bash, zsh or sh.
What is a .sh file?
Shell Script. Shell scripts automate command-line work on macOS, Linux and any Unix system. To run one you normally make it executable with chmod +x and call it as ./script.sh, or run bash script.sh directly.
Can I convert a .sh file?
Yes. It is usually converted to .bat, .ps1 or .txt, either by exporting from one of the programs listed above or with a format converter.

Related pages

Sources

  1. Media Types Registry — IANA
  2. Official vendor product documentation — At One Place

How these figures are compiled and checked