.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
- .exe — Windows Executable A Windows program. It runs code, which is why it is also the classic way to get
- .apk — Android Application Package An Android app installer — a zip of code and resources.
- .msi — Windows Installer Package A structured Windows installer that the OS installs and can cleanly uninstall.
- .dll — Dynamic Link Library Shared Windows code that programs load — not something you open or run.
- .deb — Debian Software Package The installer format for Debian, Ubuntu and their derivatives.
- .jar — Java Archive A zip of compiled Java classes — a library, or a runnable program.
- .bat — Windows Batch File A plain-text list of Command Prompt commands that runs when you double-click it.
- .pkg — macOS Installer Package A macOS installer that runs a guided setup, rather than a drag-and-drop app.
- .ps1 — PowerShell Script A script for Windows PowerShell — Microsoft's modern automation shell.
- .ipa — iOS Application Archive An iPhone or iPad app package — installable only through Apple-sanctioned channe
- .rpm — RPM Package The installer format for Fedora, Red Hat, openSUSE and their relatives.
- .appimage — AppImage Portable Application A whole Linux application in one file that runs without being installed.
Sources
- Media Types Registry — IANA
- Official vendor product documentation — At One Place